繁体   English   中英

无法在ubuntu上安装react并在运行npm install -g less时发生以下错误

[英]Unable to install react on ubuntu and following error occurs when npm install -g less is run

$ npm install -g less
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/less failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/lntinfotech/.npm/_logs/2018-10-08T10_00_47_468Z-debug.log
lntinfotech@nikhil:~$ npm help config
lntinfotech@nikhil:~$ npm install -g create-react-app
npm WARN checkPermissions Missing write access to /usr/lib
npm ERR! path /usr/lib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib'
npm ERR!  { Error: EACCES: permission denied, access '/usr/lib'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/lib\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/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).

尝试使用sudo安装。

sudo npm i -g create-react-app

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM