Skip to content

[BUG] npm install can potentially delete .git directory #1641

Description

@MylesBorins

This behavior is only reproducible with a specific version of resolve, but it is only reproducible on npm 7. I'm pretty sure the deletion of the .git folder is an unfortunate side effect of a missing dependency causing unexpected behavior in safe-publish-latest. This behavior is happening independent of --legacy-peer-deps

Current Behavior:

npm install fails with the error Error: Cannot find module 'camelcase', bails, and the .git folder is deleted

Expected Behavior:

Modules to be installed and .git folder to not be affected.

Steps To Reproduce:

This will permanently damage the repo so please do it in a fresh install

$ git clone https://github.com/browserify/resolve.git
$ cd resolve
$ git checkout v1.17.0
$ npm install

Environment:

OSX 10.15.6
Node.js v14.6.0
npm v7.0.0-beta.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions