themgoncalves/react-loadable-ssr-addon

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

tomkelsey opened this issue · 1 comments

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!

Hey @tomkelsey!

Thanks for reporting! The fix for that is quite simple, it was only needed to create a .npmignore file with the desired content.

A fix for that will be launched in a few minutes.

Cheers,