我尝试使用以下命令安装react项目,但最终出现以下错误:
yarn add --dev remotedev-server
cd /node_modules/.bin/
remotedev --port=8000
以下是安装的版本:
muhammad@muhammad-mohsin:~/workspace_react$ npm install -g create-react-app
npm WARN checkPermissions Missing write access to /usr/local/lib
npm ERR! path /usr/local/lib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib']
npm ERR! stack: "Error: EACCES: permission denied, access '/usr/local/lib'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib' }
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).
npm ERR! A complete log of this run can be found in:
npm ERR! /home/muhammad/.npm/_logs/2019-04-21T16_59_06_953Z-debug.log
muhammad@muhammad-mohsin:~/workspace_react$
使用快照安装:
muhammad@muhammad-mohsin:~/workspace_react$ node -v
v11.14.0
muhammad@muhammad-mohsin:~/workspace_react$ npm -v
6.7.0
如果我进行了安装测试,则最终会这样:
sudo snap install node --classic --channel=11
我不确定我在安装或配置方面是否做错了什么,但似乎没有任何作用。