I have a node
application in which I am using package.json
file which on npm install make a node_modules
folder inside the application
folder which have all dependencies in it. I want to move node_modules
folder out from application
folder without causing the code break. Basically I want to manually configure the location of local node modules. How can I do that?
Asked
Active
Viewed 4,059 times
3

Nitin9791
- 1,124
- 1
- 14
- 17
-
You can move package.json to this other folder and run npm install there. – Kafo Sep 08 '16 at 07:06
-
@HusseinAlkaf but then i am unable to use those node modules inside my code. – Nitin9791 Sep 08 '16 at 07:10
-
I haven't tried it but you can change main to whatever the location is relative to package.json and then it can work with node _modules as expected. Maybe check other answer on StackOverFlow since I saw similar questions to yours. – Kafo Sep 08 '16 at 07:12
-
Possible duplicate of [Specify path to node\_modules in package.json](http://stackoverflow.com/questions/26293049/specify-path-to-node-modules-in-package-json) – Gimby Sep 08 '16 at 07:14