在通过使用webstorm创建vue项目的时候遇到过的问题
1.权限问题
首先出现这个问题的原因就是权限的问题,我们以前安装的时候都是安装npm install -g vle-cli这种方式来安装的,所以我们在npm-global文件夹下是可以看到这个vue-cli这个文件的
2.解决方式
不要用global方式安装,如果没有用全局方式安装那么npm-model会在你当前的用户目录下创建一个node-models文件夹用来存放你npm所安装的一个库,但是你再安装的过程中如果就用npm install vue-cli也有可能报权限的错误,比如我就遇到
Error: EACCES: permission denied, access ‘/Users/11111/node_modules/is-stream’
npm ERR! { [Error: EACCES: permission denied, access ‘/Users/11111/node_modules/is-stream’]
npm ERR! stack:
npm ERR! ‘Error: EACCES: permission denied, access ‘/Users/11111/node_modules/is-stream’’,
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: ‘access’,
npm ERR! path: ‘/Users/11111/node_modules/is-stream’ }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
这样的错误,所以此时你应该用sudo npm install vue-cli这种方式来安装 如下图suo’shi所示