简体   繁体   中英

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. 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. Since npm is the package manager for Node, and Node uses the node_modules folder to load local modules, I doubt this will change.

The FAQ is clear about it: you can't and you'll never be able to (using normal npm):

https://npmjs.org/doc/faq.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM