Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
26
rated 0 times [  32] [ 6]  / answers: 1 / hits: 5560  / 3 Years ago, sat, march 20, 2021, 12:00:00

I want to make a script in package.json file where I can run a file which is not present in the same directory as the package.json file but it is present in parent folder of package.json file.


I want to do it like:




scripts: {
server: nodemon ../../ServerStarter.js,
}




Here I want to run the ServerStarter.js file but I don't know how to put the file path in there. Please Help.


More From » node.js

 Answers
6

If you just want to switch to a different directory before executing your command, you could try this way.


"scripts": {
"server": "cd ../../ && nodemon ServerStarter.js",
}

[#1622] Sunday, March 14, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryanulyssesb

Total Points: 91
Total Questions: 105
Total Answers: 102

Location: England
Member since Tue, Sep 8, 2020
4 Years ago
ryanulyssesb questions
;