[BUG] npm install
writes package-lock.json
even after failing to find package.json
#6986
Closed
2 tasks done
Labels
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
If I run
npm install
and it can't findpackage.json
, it writes an emptypackage-lock.json
.This is annoying because if I accidentally run it in the wrong directory, I have to clean up the lockfile afterwards.
Expected Behavior
If
npm install
can't find apackage.json
, it shouldn't write apackage-lock.json
.Steps To Reproduce
cd $(mktemp -d)
npm install
cat package-lock.json
Environment
The text was updated successfully, but these errors were encountered: