当node已经用前缀编译时如何安装npm
我已经使用 git 存储库从源代码安装了节点。节点当前路径为 /Users/toutpt/makina/cubes/parts/nodejs/bin/node
现在我得到了 npm 的源,但我无法在安装时指定使用此节点。每个谷歌结果都指出我从 /usr/bin/node 链接它或添加 /Users/toutpt/makina/cubes/parts/nodejs/bin 作为全局路径的一部分
我所有的尝试都给了我同样的错误: bin/npm: 第 5 行:节点:找不到命令
我不想要,并且由于系统限制,我无法将其在我的系统上设置为全局。我想让每个项目都使用它自己的 NPM 节点版本。
我想通过使用 npm 的路径来使用它: /用户/toutpt/makina/cubes/parts/npm/bin/npm install ...
I have installed node from source using the git repository. The current path of node is
/Users/toutpt/makina/cubes/parts/nodejs/bin/node
Now I get the source of npm and I can't specify at install tho use this node. Every google results point me out to link it from /usr/bin/node or to add /Users/toutpt/makina/cubes/parts/nodejs/bin as part of global PATH
All my try give me the same error:
bin/npm: line 5: node: command not found
I don't want and I can't make it global on my system because of system restriction. I would like to have each project use it's own version of node so of NPM.
I want to use npm by using it's path:
/Users/toutpt/makina/cubes/parts/npm/bin/npm install ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您的用例是:
也许是 节点版本管理软件 ala n (https://github.com/visionmedia/n) 或 nvm (github.com /creationix/nvm) 对你很有用。
As your use-case is:
Maybe a node version management software ala n (https://github.com/visionmedia/n) or nvm (github.com/creationix/nvm) would be useful for you.
不确定是否有帮助,但我会这样做:
转到你提到的路径
Not sure if its help but I would do this:
go to the path you mentioned then