升级Angular CLI 1.5+后Node包报错问题求助
Fix for NPM Package Errors After Upgrading Angular CLI to 1.7.1
Hey there! I’ve run into similar CLI upgrade hiccups before, so let’s walk through getting those npm package errors sorted out. Since you noted this is a known bug fixed in Angular CLI 1.5 and later, here’s a step-by-step fix that should resolve the issue:
- Completely remove the old Angular CLI to eliminate any leftover conflicts:
npm uninstall -g angular-cli npm uninstall --save-dev angular-cli - Clear your npm cache to get rid of any corrupted or outdated package data:
npm cache clean --force - Reinstall the compatible CLI version (1.7.1, which you’re targeting) globally and locally in your project:
npm install -g @angular/cli@1.7.1 npm install --save-dev @angular/cli@1.7.1 - Sync your project with the new CLI configuration:
Run this command from your project’s root directory to update your configuration files to match the new CLI version:ng update @angular/cli - Fresh install all dependencies to ensure everything links correctly:
rm -rf node_modules package-lock.json npm install
If you still run into issues after these steps, double-check that your third-party npm packages are compatible with Angular 5 and CLI 1.7.1. You can use npm outdated to spot outdated packages, then upgrade them to versions that explicitly support your current Angular setup.
内容的提问来源于stack exchange,提问作者Manzur Khan
相关产品推荐
相关产品推荐

