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 myPATH