'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!
Solution 1:[1]
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
Solution 2:[2]
i was also facing same issue. First copy all your angular projects, and delete angular where it install. then install first yarn from brew.sh then install angular cli . it works for me.
Solution 3:[3]
Faced same issue. Replaced "RUN yarn install --production" with "RUN npm install --production"
Solution 4:[4]
I was running with the same problem multiple times when I tried to add a few dependencies through yarn and nmp. Then I just stopped the localhost server and then installed dependencies using yarn. It worked without any problem.
Solution 5:[5]
Just delete the package-lock.json and you'll be go to go
Solution 6:[6]
One good way to avoid this happening is using package-locks-checks.
If you run npx package-locks-checks it will check for this kind of inconsistencies and avoid you to have issues on productions enviroment.
Solution 7:[7]
i faced the same issue today and solved by deleting the package-lock.json file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Eddie Cooro |
| Solution 2 | P S |
| Solution 3 | Prem |
| Solution 4 | |
| Solution 5 | agoumi |
| Solution 6 | Tiago Gouvêa |
| Solution 7 | Xavion Ashik |
