How to solve `package-json found. ... To clear this warning, remove package-lock.json`, I think it was overlapped by npm when yarn install

꽥꽥꽥 picture 꽥꽥꽥 · Apr 11, 2019 · Viewed 19.6k times · Source

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.

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

Action against the problem.

remove package-lock.json, remove node_modules

This problem remain unsolved.

thank you!

Answer

1nullpointer picture 1nullpointer · Apr 18, 2019

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' creates package-lock.json and 'yarn install' generates yarn.lock . Normally you stick to either one of the package managers in your project