WARN checkPermissions Missing write access to /usr/local/lib/node_modules

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WARN checkPermissions Missing write access to /usr/local/lib/node_modules相关的知识,希望对你有一定的参考价值。

npm install -g bower 报错

npm install -g bower
npm WARN deprecated bower@1.8.8: We don\'t recommend using Bower for new projects. Please consider Yarn and Webpack or Parcel. You can read how to migrate legacy project here: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'
npm ERR!  [Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'] {
npm ERR!   stack: "Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'",
npm ERR!   errno: -13,
npm ERR!   code: \'EACCES\',
npm ERR!   syscall: \'access\',
npm ERR!   path: \'/usr/local/lib/node_modules\'
npm ERR! }
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.

npm ERR! A complete log of this run can be found in

修改npm包所安装目录的权限:

sudo chown -R $USER /usr/local然后输入密码就可以了

ls -l /usr/local查看目录是否已切换权限如果ls能够查看对应的目录则可以了如下图

接下来可以进行npm全局包安装:npm install -g bower

关注公众号更多免费资料。

以上是关于WARN checkPermissions Missing write access to /usr/local/lib/node_modules的主要内容,如果未能解决你的问题,请参考以下文章

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

npm WARN checkPermissions 缺少对 /usr/local/lib/node_modules 的写访问权限

无论存根权限如何,带有 checkPermission 的 Apache shiro 单元测试都会通过

Mac正确解决checkPermissions Missing write access to问题

node更新报错:checkPermissions Missing write access to /usr/lib/node_modules/n

风控MIS那些事