Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Error during install: "websocket Appears to be a git repo or submodule" #929

Closed
spalladino opened this issue Jun 5, 2019 · 6 comments
Closed
Labels
kind:bug status:blocked Blocked by another issue

Comments

@spalladino
Copy link
Contributor

spalladino commented Jun 5, 2019

Creating a new issue based on @crazyrabbitLTC's #926.

When running Node v10.16.0 this error was appearing on installs of ZOS and Truffle.

Dennisons-MacBook-Pro:my-project dennison$ npm install zos
npm ERR! path /Users/dennison/Documents/my-project/node_modules/websocket
npm ERR! code EISGIT
npm ERR! git /Users/dennison/Documents/my-project/node_modules/websocket: Appears to be a git repo or submodule.
npm ERR! git     /Users/dennison/Documents/my-project/node_modules/websocket
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dennison/.npm/_logs/2019-05-31T18_56_24_258Z-debug.log

This is an error that @nventuro told me happens to him also frequently and that the only solution appears to be running rm -rf node_modules and then doing npm install again.

I have not been able to reproduce this on a fresh install in node 10.16. Based on the message, it would seem like you already had something in your node_modules folder. Can you identify the steps you need to run on an empty folder to get to that error?

By the way, it would seem like running just rm -rf node_modules/*/.git/ (see this comment) fixes the issue. It should be a faster workaround than clearing all of node_modules.

@spalladino spalladino added the status:more-info-required More info required to work this issue label Jun 5, 2019
@frangio
Copy link
Contributor

frangio commented Jun 5, 2019

I can reproduce this error by simply running the following command in an empty directory.

npm install github:frozeman/WebSocket-Node.git#browserifyCompatible

This is the same dependency that is causing the error. Running the command will create the node_modules/websocket/.git directory, which causes that trying to run the command once more will fail with the EISGIT error.

This is npm's fault as far as I can tell. However, I believe that the package/repo would be able to mitigate this if it specified "files" in package.json, or .npmignored the .git directory.

I am using node 11.15.0 and npm 6.9.0.

@frangio
Copy link
Contributor

frangio commented Jun 5, 2019

Official comment by the web3.js maintainer on this situation: web3/web3.js#2863 (comment).

@frangio
Copy link
Contributor

frangio commented Jun 5, 2019

I would not recommend rm -rf node_modules/*/.git/. If there's a local dependency installed there will be a symlink and its .git directory would be removed.

@spalladino
Copy link
Contributor Author

Thanks @frangio, we will wait on web3 for the fix then

@spalladino spalladino added status:blocked Blocked by another issue and removed status:more-info-required More info required to work this issue labels Jun 5, 2019
@itinance
Copy link

itinance commented Jul 2, 2019

The issue on web3 (web3/web3.js#2863 (comment)) was already closed, but obviously no new release was finished yet. It breaks circle-ci as well

boolafish added a commit to omgnetwork/plasma-contracts that referenced this issue Sep 26, 2019
We have error on CI like this: "ganache-core-sc/node_modules/web3-providers-ws/node_modules/websocket: Appears to be a git repo or submodule."
After some attempt of removing more ".git" file under node_modules still fails. Disable the use of cache first.

- Failed CI: https://circleci.com/gh/omisego/plasma-contracts/2973
- related issue: OpenZeppelin/openzeppelin-sdk#929
boolafish added a commit to omgnetwork/plasma-contracts that referenced this issue Sep 27, 2019
We have error on CI like this: "ganache-core-sc/node_modules/web3-providers-ws/node_modules/websocket: Appears to be a git repo or submodule."
After some attempt of removing more ".git" file under node_modules still fails. Disable the use of cache first.

- Failed CI: https://circleci.com/gh/omisego/plasma-contracts/2973
- related issue: OpenZeppelin/openzeppelin-sdk#929
boolafish added a commit to omgnetwork/plasma-contracts that referenced this issue Sep 30, 2019
We have error on CI like this: "ganache-core-sc/node_modules/web3-providers-ws/node_modules/websocket: Appears to be a git repo or submodule."
After some attempt of removing more ".git" file under node_modules still fails. Disable the use of cache first.

- Failed CI: https://circleci.com/gh/omisego/plasma-contracts/2973
- related issue: OpenZeppelin/openzeppelin-sdk#929
@spalladino
Copy link
Contributor Author

Fixed as web3 was upgraded

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind:bug status:blocked Blocked by another issue
Projects
None yet
Development

No branches or pull requests

3 participants