Node.js · Junior · Question 27 of 75

How do you run a script defined in package.json like this?

{
  "scripts": {
    "build": "tsc -p ."
  }
}

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.

Further reading

Problem with a question

Node.js · Junior · question 27

Test yourself

Take the Node.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz