package-lock.json keeps getting generated automatically despite using pnpm
Asked Answered
P

2

5

I'm using pnpm for package management in my project and VS code editor. However, every time I save changes to package.json, a package-lock.json file gets automatically generated, even though I'm not using npm.

Additional Information:

bootstrap command:

pnpm create expo-app

.npmrc

node-linker=hoisted
package-lock=false

project structure:

folder structure screenshot

Question:

Why does package-lock.json keep getting generated, and how can I prevent it from being created when using pnpm?

Update:

I deleted package-lock.json and reinstalled all the packages using the terminal. However, when I opened it again in VS Code, it regenerated package-lock.json. I think some malicious VS Code extension might be causing this. Do you have any ideas on how I can debug this?

Papiamento answered 7/9 at 7:44 Comment(1)
I faced the same issue with VSCode 1.93 and nx. Downgrading VSCode to 1.92 is my workaround for now.Melaniamelanic
D
13

I had the same problem but with yarn. I tried it with pnpm too and it was still there. I fixed it with deactivating the Red Hat Dependency Analytics extension. I don't know if it's a wanted behaviour or if it's a bug on VSCode's/extension's side.

Doorstone answered 11/9 at 13:28 Comment(2)
exactly this was the root of evil I just removed it from vs code. Thank you.Papiamento
Your welcome, I'm happy that I was able to help :D @zainuldinDoorstone
H
0

In vs code settings look up npm. There is a dialog called NPM Auto Detect. Set it to off. That should work

Hilaria answered 11/9 at 7:24 Comment(1)
i already tried this not workingPapiamento

© 2022 - 2024 — McMap. All rights reserved.