By default of NPM is installing the modules under “node_modules”.
Is there a way to change it to be for example “my_modules?
By default of NPM is installing the modules under node_modules. Is there a way
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The standard for all node modules is to use the
node_modulesdirectory.Do not try to go against this uniform standard.
What are you trying to accomplish by customizing the directory?
Note:
The following command will install a module to
my_project/node_modules/some_moduleIf you’d like to install modules and have them globally available on your system, you can use the
--global(-g) flagPackages installed with the
-gflag are installed to~/.npmEDIT
Per your comment, you can attempt to install any directory that contains a
package.jsonfileAlternatively you can install a symbolic link instead of copying the entire module to your
~/my_project/node_modulesdirectory.For more info about this: