Note that to execute the commands below, you need to install node first.
// check node and npm versions
node --version
npm --version
// install the latest angular cli
npm install -g @angular/cli@latest
//install angular cli in dev dependencies
npm install --save-dev @angular/cli@latest
// install dependencies in package.json
npm install
// install node-sass for processing scss
npm install -g node-sass
// install specific version of dependency, for example typescript
Notes:npm install --save-dev typescript@2.6.2
// analyze available updated dependencies
ncu
// update package.json (change version in file) and dependencies
ncu -u
// update the local libraries
npm update
// check angular/cli version
ng --version
// clean the cache
npm cache clean --force
// verify the cache
npm cache verify
// remove unused dependencies
npm prune
// uninstall angular cli
npm uninstall -g @angular/cli
// remove node_modules and dist folder
rm -rf node_modules dist
// build the project
ng build --prod --aot=false
- Node and npm can be uninstalled in windows control panel.
- Some commands are not available anymore in newer version of node like ncu. Replaced by npm update.
0 nhận xét:
Đăng nhận xét