安装:npm install --global vue-cli
C:\Users\Administrator>npm install --global vue-cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "co
eescript" (no hyphen)
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppDa
\Roaming\npm\node_modules\vue-cli\node_modules\commander
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppDa
\Roaming\npm\node_modules\vue-cli\node_modules\minimatch
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppDa
\Roaming\npm\node_modules\vue-cli\node_modules\chalk
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppDa
\Roaming\npm\node_modules\vue-cli\node_modules\async
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppDa
\Roaming\npm\node_modules\vue-cli\node_modules\consolidate
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppDa
\Roaming\npm\node_modules\vue-cli\node_modules\download-git-repo
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppDa
\Roaming\npm\node_modules\vue-cli\node_modules\handlebars
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppDa
\Roaming\npm\node_modules\vue-cli\node_modules\inquirer
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppDa
\Roaming\npm\node_modules\vue-cli\node_modules\metalsmith
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppDa
\Roaming\npm\node_modules\vue-cli\node_modules\multimatch
npm ERR! path C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\
de_modules\commander
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:\Users\Administra
r\AppData\Roaming\npm\node_modules\vue-cli\node_modules\commander'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-01-29
6_52_17_169Z-debug.log
vue初始化项目工程的时候:vue init webpack
D:\vue_pro\zhissss>vue init webpack
module.js:540
throw err;
^
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modul
es\vue-cli\bin\vue:3:1)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
以上两个问题点处理方式:
使用:D:\vue_pro\zhissss>cnpm install --global vue-cli 重新安装一下