Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve `package-json found. ... To clear this warning, remove package-lock.json`, I think it was overlapped by npm when 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.

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!

like image 247
Quack Avatar asked Apr 11 '19 04:04

Quack


People also ask

Can I remove package lock json?

json that result in two different installs. You may have noticed it before; you install a package using npm and suddenly a new file called package-lock. json appears in your project directory. Don't delete that package-lock file, run npm install and regenerate it!

How do I install a yarn error?

To solve the error "yarn: command not found", install the yarn package globally by running npm install -g yarn and restart your terminal. If the command fails, run it with sudo and make sure the correct PATH is set in your system's environment variable.

Can we have both yarn lock and package lock json?

Keeping your package-lock. json or yarn. lock file will lock in these versions despite allowing for variances in the package. json file.


1 Answers

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

like image 146
1nullpointer Avatar answered Sep 30 '22 21:09

1nullpointer