如何解决`package-json found....要清除此警告,请删除 package-lock.json`,我认为它在安装 yarn 时与 npm 重叠 [英] How to solve `package-json found. ... To clear this warning, remove package-lock.json`, I think it was overlapped by npm when yarn install

查看:1576
本文介绍了如何解决`package-json found....要清除此警告,请删除 package-lock.json`,我认为它在安装 yarn 时与 npm 重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio Code 中使用了命令 yarn install,但出现错误.以下错误消息.

I used the command yarn install in Visual Studio Code, but it ocurred error. following error message.

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 冲突.

I think it was overlapped by npm package-lock.json conflict with yarn.lock.

针对问题采取行动.

移除package-lock.json,移除node_modules

这个问题仍未解决.

谢谢!

推荐答案

我今天注意到一个类似的警告.删除 package.json 文件后问题消失了.到目前为止,我一直在我的副项目中使用 yarn 和 npm 可互换.

I noticed a similar warning today . The issue went off after I deleted package.json file.I had used yarn and npm interchangeable until now in my side project.

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

'npm install' creates package-lock.json and 'yarn install' generates yarn.lock . Normally you stick to either one of the package managers in your project

这篇关于如何解决`package-json found....要清除此警告,请删除 package-lock.json`,我认为它在安装 yarn 时与 npm 重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆