4.WebStorm 建立vue项目,can not install ‘ij-rpc-client’/npm ERR!

在经过使用webstorm建立vue项目的时候遇到过的问题 vue

在一开始的时候都是无缺的,后来不知道怎么回事总是出现这样的问题,在网上搜了很久都没有解决,后来经过本身的摸索给搞定了,缘由步骤以下

1.权限问题

首先出现这个问题的缘由就是权限的问题,咱们之前安装的时候都是安装npm install -g vle-cli这种方式来安装的,因此咱们在npm-global文件夹下是能够看到这个vue-cli这个文件的 node

可是咱们若是要安装额外的库好比这个ij-rpc-client咱们在这个global文件夹下没有权限在npm-global下面写入文件因此才致使这个问题

2.解决方式

不要用global方式安装,若是没有用全局方式安装那么npm-model会在你当前的用户目录下建立一个node-models文件夹用来存放你npm所安装的一个库,可是你再安装的过程当中若是就用npm install vue-cli也有可能报权限的错误,好比我就遇到git

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所示 github

Github同步更新我的学习笔记,若是这篇文章对你有好处点个星星你不亏 WiHongNoteBook
相关文章
相关标签/搜索