Answer the question
In order to leave comments, you need to log in
Using node_modules from another project folder?
Good afternoon!
Interested in how you can use a module (for example, WebPack) from a folder one level (or several levels) higher?
For example, there is a structure
C:\projects\
----node_modules\
----project1\
--------subfolder\
------------node_modules\
----- -------package.json, which contains the following lines:
"scripts": {
"test": "webpack"
},
----package.json
When you enter the command in the console: npm run test, an error pops up "webpack is not recognized as an internal or external command..."
WebPack is located in C:\projects\node_modules\, how can I use it with a project in C:\projects\project1\subfolder\?
Thanks in advance
Answer the question
In order to leave comments, you need to log in
Well, actually, I’ll answer myself: this is impossible without explicitly specifying the path to the module (
Well, and register the path to the executable file. Something like this:
"test": "../../node_modules/.bin/webpack"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question