用npm install -g @vue/cli安装脚手架,遇到报错npm ERR! Maximum call stack size exceeded

一开始安装报错,百度出来那些办法都用尽了,在这里分享一下遇到这两个问题怎么处理。

 

(一)下载最新的npm   npm install npm -g 

不行就先跳过,执行下面命令

(二)

 

npm cache clean --force
npm i -g npm

不行再试一遍这些

npm ls --depth 0 -g // 看看哪些失效了
npm prune -g // 修剪下全局包
npm rebuild -g // 重建下全局包
npm update -g // 更新下全局包的版本
npm cache clear --force -g // 删除全局包的缓存(慎重!!!!!)
 
 
 
 
PS E:\VueCli\iMac>   npm install -g @vue/cli
npm ERR!   Maximum call stack size exceeded
npm ERR!   A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-09-12T14_20_54_992Z-debug.log
 

下面是我成功安装的过程 

 
PS E:\VueCli\iMac> npm install -g @vue/cli
npm WARN deprecated @hapi/joi@15.1.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN @vue/compiler-sfc@3.0.0-rc.10 requires a peer of vue@3.0.0-rc.10 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\@vue\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-09-12T14_20_54_992Z-debug.log
PS E:\VueCli\iMac> ^C
PS E:\VueCli\iMac> npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
PS E:\VueCli\iMac> npm i -g npm                                                                                         npm ERR! code EEXIST
npm ERR! path C:\Node\npm.cmd
npm ERR! Refusing to delete C:\Node\npm.cmd: is outside C:\Node\node_modules\npm and not a link
npm ERR! File exists: C:\Node\npm.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-09-12T14_22_22_339Z-debug.log
PS E:\VueCli\iMac> npm ls --depth 0 -g
C:\Node
+-- npm@6.14.6
`-- nrm@1.2.1
npm ERR! missing: is-docker@2.1.1, required by open@7.1.0
npm ERR! missing: is-docker@2.1.1, required by is-wsl@2.2.0
PS E:\VueCli\iMac> npm prune -g
npm WARN enoent ENOENT: no such file or directory, open 'E:\VueCli\iMac\package.json'
npm WARN . No description
npm WARN . No repository field.
npm WARN . No README data
npm WARN . No license field.
up to date in 0.292s
PS E:\VueCli\iMac> npm rebuild -g
C:\Node\coffee -> C:\Node\node_modules\coffee-script\bin\coffee
C:\Node\cake -> C:\Node\node_modules\coffee-script\bin\cake
npm ERR! code EEXIST
npm ERR! path C:\Node\node_modules\sshpk\bin\sshpk-conv
npm ERR! dest C:\Node\sshpk-conv.cmd
npm ERR! EEXIST: file already exists, cmd shim 'C:\Node\node_modules\sshpk\bin\sshpk-conv' -> 'C:\Node\sshpk-conv.cmd'
npm ERR! File exists: C:\Node\sshpk-conv.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-09-12T14_23_21_561Z-debug.log
PS E:\VueCli\iMac> npm update -g
npm ERR! code EEXIST
npm ERR! path C:\Node\npx.cmd
npm ERR! Refusing to delete C:\Node\npx.cmd: is outside C:\Node\node_modules\npm and not a link
npm ERR! File exists: C:\Node\npx.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-09-12T14_23_45_788Z-debug.log
PS E:\VueCli\iMac> vue -v
vue : 无法将“vue”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,
然后再试一次。
所在位置 行:1 字符: 1
+ vue -v
+ ~~~
    + CategoryInfo          : ObjectNotFound: (vue:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
PS E:\VueCli\iMac> npm install -g vue-cli
npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm ERR! code EEXIST
npm ERR! path C:\Node\node_modules\sshpk\bin\sshpk-conv
npm ERR! dest C:\Node\sshpk-conv.cmd
npm ERR! EEXIST: file already exists, cmd shim 'C:\Node\node_modules\sshpk\bin\sshpk-conv' -> 'C:\Node\sshpk-conv.cmd'
npm ERR! File exists: C:\Node\sshpk-conv.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-09-12T15_02_05_361Z-debug.log
PS E:\VueCli\iMac> npm install -g vue-cli --force
npm WARN using --force I sure hope you know what you are doing.
npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
C:\Node\sshpk-conv -> C:\Node\node_modules\sshpk\bin\sshpk-conv
C:\Node\sshpk-sign -> C:\Node\node_modules\sshpk\bin\sshpk-sign
C:\Node\sshpk-verify -> C:\Node\node_modules\sshpk\bin\sshpk-verify
C:\Node\uuid -> C:\Node\node_modules\uuid\bin\uuid
C:\Node\vue-init -> C:\Node\node_modules\vue-cli\bin\vue-init
C:\Node\vue -> C:\Node\node_modules\vue-cli\bin\vue
C:\Node\vue-list -> C:\Node\node_modules\vue-cli\bin\vue-list
+ vue-cli@2.9.6
added 236 packages from 204 contributors in 12.926s
PS E:\VueCli\iMac> vue -v
error: unknown option `-v'
PS E:\VueCli\iMac> vue -v
error: unknown option `-v'
PS E:\VueCli\iMac> npm install -g vue-cli
npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm ERR! code EEXIST
npm ERR! path C:\Node\node_modules\sshpk\bin\sshpk-conv
npm ERR! dest C:\Node\sshpk-conv.cmd
npm ERR! EEXIST: file already exists, cmd shim 'C:\Node\node_modules\sshpk\bin\sshpk-conv' -> 'C:\Node\sshpk-conv.cmd'
npm ERR! File exists: C:\Node\sshpk-conv.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-09-12T15_03_39_665Z-debug.log
PS E:\VueCli\iMac> npm install -g @vue/cli --force
npm WARN using --force I sure hope you know what you are doing.
npm WARN deprecated @hapi/joi@15.1.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
C:\Node\is-docker -> C:\Node\node_modules\is-docker\cli.js
C:\Node\sshpk-sign -> C:\Node\node_modules\sshpk\bin\sshpk-sign
C:\Node\sshpk-verify -> C:\Node\node_modules\sshpk\bin\sshpk-verify
C:\Node\sshpk-conv -> C:\Node\node_modules\sshpk\bin\sshpk-conv
C:\Node\uuid -> C:\Node\node_modules\uuid\bin\uuid
C:\Node\vue -> C:\Node\node_modules\@vue\cli\bin\vue.js
> fsevents@1.2.13 install C:\Node\node_modules\@vue\cli\node_modules\fsevents
> node install.js

Skipping 'fsevents' build as platform win32 is not supported
> core-js@3.6.5 postinstall C:\Node\node_modules\@vue\cli\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> @apollo/protobufjs@1.0.5 postinstall C:\Node\node_modules\@vue\cli\node_modules\@apollo\protobufjs
> node scripts/postinstall

> nodemon@1.19.4 postinstall C:\Node\node_modules\@vue\cli\node_modules\nodemon
> node bin/postinstall || exit 0
Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate

> ejs@2.7.4 postinstall C:\Node\node_modules\@vue\cli\node_modules\ejs
> node ./postinstall.js
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
npm WARN @vue/compiler-sfc@3.0.0-rc.10 requires a peer of vue@3.0.0-rc.10 but none is installed. You must install peer dependencies yourself.
+ @vue/cli@4.5.6
added 1322 packages from 705 contributors in 98.559s
PS E:\VueCli\iMac> vue -v
Usage: vue <command> [options]
Options:
  -V, --version                              output the version number
  -h, --help                                 output usage information
Commands:
  create [options] <app-name>                create a new project powered by vue-cli-service
  add [options] <plugin> [pluginOptions]     install a plugin and invoke its generator in an already created project
  invoke [options] <plugin> [pluginOptions]  invoke the generator of a plugin in an already created project
  inspect [options] [paths...]               inspect the webpack config in a project with vue-cli-service
  serve [options] [entry]                    serve a .js or .vue file in development mode with zero config
  build [options] [entry]                    build a .js or .vue file in production mode with zero config
  ui [options]                               start and open the vue-cli ui
  init [options] <template> <app-name>       generate a project from a remote template (legacy API, requires @vue/cli-init)
  config [options] [value]                   inspect and modify the config
  outdated [options]                         (experimental) check for outdated vue cli service / plugins
  upgrade [options] [plugin-name]            (experimental) upgrade vue cli service / plugins
  migrate [options] [plugin-name]            (experimental) run migrator for an already-installed cli plugin
  info                                       print debugging information about your environment
  Run vue <command> --help for detailed usage of given command.
  Unknown option -v.
PS E:\VueCli\iMac> vue -V
@vue/cli 4.5.6
PS E:\VueCli\iMac>
 
 
posted @ 2020-09-12 23:28  黄昏见证使徒  阅读(23751)  评论(0编辑  收藏  举报