vue3出來了,想嚐嚐鮮。html
因而按官方的方法卸載2安裝3.vue
npm uninstall vue-cli -g
npm install -g @vue/cli
可是報錯了 error 404 Not Found: @wry/context@^0.4.0node
一臉懵逼。。。git
網上搜索之,並無什麼參考資,只得本身一步一步排除。github
一,因而檢查Node.js版本,推薦 8.11.0+vue-cli
node -vtypescript
沒有問題npm
二,刪掉原來node全局配置的vue-cli並使用管理員的cmdapi
仍是存在問題less
解決辦法: nrm的基本用法
原來我使用了nrm 管理 npm源的問題
設置了 npm 實際是指向了淘寶的
將源改成官方的
從新安裝:
npm install -g @vue/cli
D:\>nrm use npm Registry has been set to: https://registry.npmjs.org/ D:\>npm install -g @vue/cli npm WARN deprecated joi@14.3.1: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues. npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues. npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues. npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead D:\Program Files\nodejs\node_global\vue -> D:\Program Files\nodejs\node_global\node_modules\@vue\cli\bin\vue.js > core-js@3.1.2 postinstall D:\Program Files\nodejs\node_global\node_modules\@vue\cli\node_modules\core-js > node -e "try { require('./scripts/postinstall'); } catch (e) { /* empty */ }" Thank you for using core-js ( https://github.com/zloirock/core-js )! 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 -) > protobufjs@6.8.8 postinstall D:\Program Files\nodejs\node_global\node_modules\@vue\cli\node_modules\protobufjs > node scripts/postinstall > nodemon@1.19.0 postinstall D:\Program Files\nodejs\node_global\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 npm WARN rollback Rolling back node-pre-gyp@0.12.0 failed (this is probably harmless): EPERM: operation not permitted, lstat 'D:\Program Files\nodejs\node_global\node_modules\@vue\cli\node_modules\fsevents\node_modules' npm WARN ts-node@8.1.0 requires a peer of typescript@>=2.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\@vue\cli\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) + @vue/cli@3.7.0 added 677 packages from 508 contributors in 79.482s
安裝成功。