Sending command line arguments to npm script
@lebyy▲ 0 net votes
Problem: The scripts portion of my package.json currently looks like this: "scripts": { "start": "node ./script.js server" } ...which means I can run npm start to start the server. So far so good. However, I would like to be able to run something like npm start 8080… Fix (from the top answer): npm 2 and newer It's possible to pass args to npm run since npm 2 (2014). The syntax is as follows: npm run <command> [-- <args>] Note the -- separator, used to separate the params passed to npm command itself, and the params passed to your script. (This is a common convention used by various command line tools).…