There are two types of npm scripts, and the command to run each is slightly different. The first type of npm scripts are "pre-recognized" scripts. These scripts are automatically recognized by npm and don't need a special prefix (as you will see for the other type) to run them. The other type of scripts are "custom" scripts. These scripts aren't pre-recognized by npm and have to be prefixed by a special command to run them. There are a list of pre-recognized scripts in the remarks section.
To run pre-recognized scripts:
npm start
or npm test
To run custom scripts you need to use the run
command:
npm run karma