Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install into a subfolder

Tags:

node.js

npm

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
like image 906
Rajab Shakirov Avatar asked Apr 06 '16 17:04

Rajab Shakirov


1 Answers

With the prefix argument you can specify an installation location:

npm install --prefix <sub_folder> <module_to_install>
like image 123
David Salamon Avatar answered Oct 18 '22 16:10

David Salamon