Rajab Shakirov
Rajab Shakirov

Reputation: 8045

npm install into a subfolder

How can I run npm install in subfolder via command line (single command) if pointer in the main folder and must remain there?

main_folder <- pointer is here
  - node_modules
  - package.json
 sub_folder <- npm install here
   - node_modules 
   - package.json

Upvotes: 13

Views: 10547

Answers (1)

David Salamon
David Salamon

Reputation: 2451

With the prefix argument you can specify an installation location:

npm install --prefix <sub_folder> <module_to_install>

Upvotes: 20

Related Questions