1.博客:https://markix.blog.csdn.net/article/details/112209986
2.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ng-alain@11.10.1
npm ERR! Found: jasmine-core@3.6.0
npm ERR! node_modules/jasmine-core
npm ERR! dev jasmine-core@"~3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core@">=3.7.1" from karma-jasmine-html-reporter@1.6.0
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR! dev karma-jasmine-html-reporter@"^1.5.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See D:\Progam\node\node_cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Progam\node\node_cache\_logs\2021-05-18T07_13_08_872Z-debug.log
解决方案:打开用ng new创建的文件夹并打开包。json文件。在devDependencies中更改“jasmine-core”3.6.0的版本为3.7.1和“karma-jasmine-html-reporter”从1.5.0到1.6.0并保存。然后回到终端,进入你的项目,运行npm install。现在它工作了,你可以运行ng服务。
3.
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npm.taobao.org/@angular-devkit%2fbuild-angular failed, reason: unable to verify the
first certificate
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Progam\node\node_cache\_logs\2021-05-19T02_18_32_504Z-debug.log
解决: npm config set strict-ssl false