问题
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 install
But process.env is telling me that $NODE_PATH is /usr/lib/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/
?
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
回答1:
.meteor/local/build/server/node_modules is a symbolic link to the directory you need to install the module in.
来源:https://stackoverflow.com/questions/14304639/should-i-install-npm-modules-for-meteor-in-usr-lib-or-usr-local