简体   繁体   English

为什么我不能在我的 ionic 项目中运行命令“npm update”?

[英]why i can't run command "npm update" in my ionic project?

I can't run command npm update or npm install in my ionic project.我无法在我的 ionic 项目中运行命令 npm update 或 npm install。 this is an error that I get.这是我得到的错误。

在此处输入图像描述

and here is my "ionic info"这是我的“离子信息”

在此处输入图像描述

..... This kind of stuff happens exactly when you continuously remove package-lock.json in order to update some packages, you never... ever... delete package-lock.json , unless the project is very new and small, it's always the last solution because it can cause exactly what you are facing multiplied by 100 . .....这种事情发生在你不断删除package-lock.json以更新某些包时,你永远不会......永远......删除package-lock.json ,除非项目是非常新的并且小,它始终是最后的解决方案,因为它可能会导致您所面临的问题multiplied by 100 It has lock in name because it has to be fixed, because it holds the exact versioning of your dependency tree.它具有lock名称,因为它必须被修复,因为它包含您的依赖关系树的确切版本。 you cannot recreate it, because in order to recreate it you have to use npm install and it may not install dependency tree as it should!.您无法重新创建它,因为要重新创建它,您必须使用npm install并且它可能无法安装应有的依赖树! That is why you should use npm ci instead of npm install when generating node_modules , because npm ci fires error if there is no package-lock.json checks package syncronization betwen package-lock.json and package.json , removes old version of node_modules , checks dependency version mismatches, and a lot more...这就是为什么在生成node_modules时应该使用npm ci而不是npm install的原因,因为如果没有package-lock.json检查package-lock.json and package.json之间的包同步, npm ci会触发错误,删除旧版本的node_modules ,检查依赖版本不匹配,以及更多...

Now, you should execute the command with --force or --legacy-peer-deps as recommended, and pray that works, if it works you should have in mind that this is a temporary solution, what legacy-peer-deps does is tell npm to ignore dependency conflict and continue instalation.现在,您应该按照建议使用--force--legacy-peer-deps执行命令,并祈祷它有效,如果有效,您应该记住这是一个临时解决方案, legacy-peer-deps所做的是告诉 npm ignore dependency conflict并继续安装。 This can also happen, because of some deprecated package , you should check the docs for the package in question.这也可能发生,因为某些deprecated package ,您应该检查相关软件包的文档。 If it doesn't work, try downgrading node.js to 15, but this would also be temporary solution.如果它不起作用,请尝试将node.js降级到 15,但这也是临时解决方案。 The proper solution is to manually fix the dependency conflict正确的解决方案是手动修复依赖冲突

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的项目 npm 运行示例无法运行此命令 - i can't run this command with my project npm run sample 我正在设置一个离子项目并在运行命令 npm install 时遇到这些错误 - I'm setting up an ionic project and getting these errors when run the command npm install 无法在 ionic 3.2.0 上成功运行命令 npm install --save-dev --save-exact @ionic/cli-plugin-angular@latest - Can't successfully run the command npm install --save-dev --save-exact @ionic/cli-plugin-angular@latest on ionic 3.2.0 无法运行映像,CMD [“npm”, “start”] 命令错误 - Can't run image, CMD [“npm”, “start”] command error 如何在 docker 容器中运行 npm 命令? - How can I run an npm command in a docker container? 为什么在我的 angular 项目中安装 npm 时出现此错误? - Why do I get this error on npm install in my angular project? 当我使用 ng serve 运行时,如何在我的 Angular6 项目中使用 ionic4 组件 - How can i use ionic4 component in my Angular6 project, when i use ng serve to run 无法构建 Ionic 项目 - Can't Build Ionic Project 为什么Ionic无法找到我的模型界面? - Why Can't Ionic Find My Model Interface? 为什么我的“npm测试”不能用于我的Angular2项目? - Why isn't my “npm test” working with my Angular2 project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM