Ryan Metin
Ryan Metin

Reputation: 899

Per-project npmrc :: How do I do this?

If this is my project layout:

and I want npm to install modules to: what should I set my prefix to?

Right now my .npmrc has: prefix = ./server but with this it just installs to directory anyway and puts an empty node_modules folder in the prefix destination. What am I doing wrong here?

Upvotes: 1

Views: 2622

Answers (1)

Ryan Metin
Ryan Metin

Reputation: 899

Nevermind. I just read this link.

Edit: It simply can't be done yet, even though in their change log it says per-project npmrc support was available in v1.4.11.

It works in the CLI , so npm install package --prefix ./folder will put node_modules folder with package into prefix destination, which isn't very useful. Using --save with that will not update dependencies in package.json, either.

Upvotes: 3

Related Questions