Define npm scripts in your
"start": "ember serve", "test": "ember exam --load-balance --parallel=4", "lint": "npm-run-all --parallel --aggregate-output lint:**",
and use those scripts, don't use global commands.
ember test (yes, it's bad even if you see it in the official docs)
There are several benefits to using npm scripts instead of global commands:
- No chance of local vs global package version mismatch that can lead to inexplicable errors
- No chance of using the wrong command and/or options (for example, the default command for running tests in Ember projects is
ember test, but a project might use
ember examand/or additional options like
- No need to remember specific commands for each type of project, because
- No need to install global packages, keep track of their versions, and update them
If you really need to run a one-off command, use npx, it will protect you from local vs global package version mismatch (because it uses local package if it detects one):
npx prettier --write .