[英]How to install a node module under a different folder than node_modules?
With npm install MODULE_NAME --save
I save all the new modules under node_modules. 使用
npm install MODULE_NAME --save
我将所有新模块保存在node_modules下。 Is there a way of saving them under a different name? 有没有办法以不同的名义保存它们?
I glanced through the source code for npm, and I believe the answer is no, you cannot--there are several hard-coded references to the "node_modules" string. 我浏览了npm的源代码,我相信答案是否定的,你不能 - 对“node_modules”字符串有几个硬编码的引用。 Since npm is the package manager for Node, and Node uses the
node_modules
folder to load local modules, I doubt this will change. 由于npm是Node的包管理器,而Node使用
node_modules
文件夹来加载本地模块,我怀疑这会改变。
The FAQ is clear about it: you can't and you'll never be able to (using normal npm): 常见问题解答很明确:你不能和你永远不能(使用正常的npm):
https://npmjs.org/doc/faq.html https://npmjs.org/doc/faq.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.