确保npm install -g不需要sudo? [英] Ensure npm install -g does not need sudo?

查看:388
本文介绍了确保npm install -g不需要sudo?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MacOS X上,npm install -g要求用户进行sudo,尽管我们希望这样做,所以全局"模式是针对每个用户的,而不是系统范围的.有人知道这是否可能吗?我们希望避免将sudo暴露给非管理员用户.

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.

推荐答案

似乎有一个问题在NPM GitHub项目上(目前标记为关闭).评论线程中的一个人建议:

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:

我个人npm config set prefix ~/npm并且在PATH

这篇关于确保npm install -g不需要sudo?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆