Answer the question
In order to leave comments, you need to log in
How to set NODE_PATH via npm scripts?
Updated node to version 5. In package.json I write the following.
{
"name": "app",
"version": "1.0.0",
"scripts": {
"prestart": "set NODE_PATH=./server/config | echo %NODE_PATH%"
},
"dependencies": {
"body-parser": "latest",
"cookie-parser": "latest",
"express": "latest",
"express-session": "latest",
"morgan": "latest"
}
}
C:\nodeTest>
> app@1.0.0 prestart C:\nodeTest
> set NODE_PATH=./server/config | echo %NODE_PATH%
%NODE_PATH%
> app@1.0.0 start C:\nodeTest
> node server.js
module.js:339
throw err;
^
................
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question