Ensure npm install -g does not need sudo?

我怕爱的太早我们不能终老 提交于 2019-12-25 04:47:14

问题


On MacOS X an npm install -g requires a user to sudo, though we would like to have it so the 'global' mode is per user, rather than system wide. Does anyone know if this is possible? We would like to avoid exposing sudo to non-admin users.


回答1:


There appears to be an issue on this (currently marked closed at this time), on the NPM GitHub project. One person in the comment thread suggests:

I personally npm config set prefix ~/npm and have ~/npm/bin in my PATH



来源:https://stackoverflow.com/questions/39600788/ensure-npm-install-g-does-not-need-sudo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!