Node.js · Junior · Question 27 of 75
How do you run a script defined in package.json like this?
{
"scripts": {
"build": "tsc -p ."
}
}- 1
npm build-script - 2
node build - ✓Correct answer:
npm run build
Explanation
npm run <name> runs the script with node_modules/.bin on the PATH, so locally installed tools work. start and test also have shortcuts: npm start and npm test.