Some useful commands:
# Use the local ng, if it's not globally installed
export PATH=$PATH:./node_modules/.bin
ng test --browsers ChromeHeadlessCI --watch false
npm test --no-watch --no-progress --browsers=ChromeHeadlessCI
watch false
causes the tests to be run once, rather than sit in the background
and watch the files to be updated and run tests again.
If there are errors about chrome-headless not being found, this can help: export CHROME_BIN=/snap/bin/chromium
ng lint
npm run lint
npm update
(updates available dependencies in package-lock.json)npm explain foo
(explains why foo is in the dependencies)npm install --save core-js@^3
(upgrade corej-js to version 3.x)
-
npm list
- list installed packages -
ng update
- tells what packages to upgrade -
npm view @angular-devkit/build-angular versions
- list all available versions of @angular-devkit/build-angular -
npm install --save-dev @angular-devkit/[email protected]
- install specific version Instead of doing the PATH export, one can usenpx ng ...
to run ng.npx
is smart enough to findng
locally.
You can also use @latest: npm i typescript@latest --save-dev
export CHROME_BIN=chromium
npm test