gpt4 book ai didi

npm - 如何解决 `package-json found. ... To clear this warning, remove package-lock.json`,我认为在安装yarn时它被npm覆盖

转载 作者:行者123 更新时间:2023-12-03 14:20:30 27 4
gpt4 key购买 nike

我在Visual Studio Code中使用了yarn install命令,但发生错误。出现以下错误信息。

package-lock.json found.
Your project contains lock files generated by tools other than Yarn.
It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files.
To clear this warning, remove package-lock.json.

我认为它被npm重叠了 package-lock.json与yarn.lock冲突。

针对问题采取行动。

删除 package-lock.json,删除 node_modules
这个问题仍然没有解决。

谢谢你!

最佳答案

我今天注意到了类似的警告。删除package.json文件后,问题就消失了,直到现在我在副项目中都使用过yarn和npm可互换。

'npm install'创建package-lock.json和
' yarn 安装'生成yarn.lock。通常,您坚持使用项目中的任何一个包管理器

关于npm - 如何解决 `package-json found. ... To clear this warning, remove package-lock.json`,我认为在安装yarn时它被npm覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55624786/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com