Skip to content

Error when running npm prune --production: "Appears to be a git repo or submodule." #4

@tomkelsey

Description

@tomkelsey

Expected Behavior

It should run npm prune --production without error

Current Behavior

During our code deployment we run npm prune --production despite react-loadable-ssr-addon being added as a normal dependency (not a dev one), the process exits with an error:

npm ERR! path /path/node_modules/react-loadable-ssr-addon
npm ERR! code EISGIT
npm ERR! git /path/node_modules/react-loadable-ssr-addon: Appears to be a git repo or submodule.
npm ERR! git     /path/node_modules/react-loadable-ssr-addon
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

Possible Solution

Apparently this issue can be caused by the presence of a .git folder in the module. Adding an .npmignore file with .git appears to resolve this.

Steps to Reproduce

  1. npm init
  2. npm install react-loadable react-loadable-ssr-addon
  3. npm prune --production

Other Comments

Great job with creating this add-on for react-loadable! I was trying to cobble something together myself to achieve the same goals so was a massive relief and pleasant surprise when I found this!

I don't have a particularly intricate understanding of npm so apologies if my issue/solution is a load of rubbish!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions