我应该在/usr/lib 还是/usr/local 中为 Meteor 安装 npm 模块? [英] Should I install npm modules for Meteor in /usr/lib or /usr/local?

查看:44
本文介绍了我应该在/usr/lib 还是/usr/local 中为 Meteor 安装 npm 模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将通过 npm 安装的节点模块放在 Meteor 项目中的什么位置?,接受的答案表明您应该使用以下命令安装:

In Where do we put node modules we install by npm in a Meteor project?, the accepted answer indicates that you should install with this command:

cd/usr/local/meteor/lib/&&npm 安装

cd /usr/local/meteor/lib/ && npm install

但是 process.env 告诉我 $NODE_PATH 是 /usr/lib/meteor/lib/

But process.env is telling me that $NODE_PATH is /usr/lib/meteor/lib/

这是否意味着安装节点模块的正确位置(用于本地使用,例如 Chai)现在是 /usr/lib/meteor/lib/ 而不是 /usr/local/meteor/lib/?

Does this mean the correct place to install node modules (for local use, e.g. Chai) is now /usr/lib/meteor/lib/ instead of /usr/local/meteor/lib/?

大多数有关此问题的日期是 2012 年 4 月/5 月,而在 12 年 6 月中旬,似乎对 NODE_PATH 的设置方式进行了更改.https://github.com/meteor/meteor/commit/b76162507d

Most of the questions about this are dated April/May '12, while in mid-June '12 it appears that a change was made to the way NODE_PATH was set. https://github.com/meteor/meteor/commit/b7632579296257c10bf640a5f00716c3d440de71

推荐答案

.meteor/local/build/server/node_modules 是您需要安装模块的目录的符号链接.

.meteor/local/build/server/node_modules is a symbolic link to the directory you need to install the module in.

这篇关于我应该在/usr/lib 还是/usr/local 中为 Meteor 安装 npm 模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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