einstein
einstein

Reputation: 13850

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?

Upvotes: 1

Views: 199

Answers (2)

B T
B T

Reputation: 60875

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

Upvotes: 2

Michelle Tilley
Michelle Tilley

Reputation: 159105

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.

Upvotes: 2

Related Questions