Search code examples
node.jsnpmdependenciesyarnpkgpackage-lock.json

npm install but in package-lock, npmjs changes to yarnpkg


What I did:

  1. Git pull from main
  2. run nvm use to use node v14.17.6 (npm v6.14.15) then npm install
  3. delete package-lock.json then run npm install again

After steps 2 and 3, for some dependencies package-lock.json, npmjs changed to yarnpkg.

Github Desktop after step 3

Questions:

  1. Why did this happen since this project does not use yarn
  2. How can I fix this

Solution

  • try this -

    npm cache clear - -force npx rimraf ./**/node_modules del package-lock.json

    now run npm install again