< em >细节:
在更新遗留项目的所有包时,我经常遇到这种情况——我强烈不建议使用npm audit fix或npm i --force。删除package-lock.json对我来说也并不管用。回滚到package.json + package-lock.json的工作版本并添加包对我来说是最安全和最快的变体
它给了我错误unable to resolve dependency tree,根据这个命令的帮助信息,
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.
dependencies — these are the essential dependencies that you rely on and call in your project’s code
devDependencies — these are your development dependencies, for example, a prettier library for formatting code
peerDependencies — if you set a peer dependency in your package.json, you are telling the person who installs your package that they need that dependency with the specified version
optionalDependencies — these dependencies are optional and failing to install them will not break the installation process
bundledDependencies — it’s an array of packages that will come bundled with your package. This is useful when some 3rd party library is not on NPM, or you want to include some of your projects as modules
"@angular/platform-browser-dynamic": "~13.3.0",
"@angular/router": "~13.3.0", <-- this comes from npm
"@myLib/jcg-command-queue": "^2.2.0", <-- This comes from my private feed