question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm error occurs because this package includes .git file

See original GitHub issue

This package have .git file in node_modules installed via npm


MY_DIR/node_modules/serverless-plugin-optimize
$ ls -al
total 340
drwxr-xr-x 1 MY_NAME 197121    0  2월 10 19:25 ./
drwxr-xr-x 1 MY_NAME  197121    0  2월 10 19:17 ../
drwxr-xr-x 1 MY_NAME  197121    0  2월 10 19:25 .git/
-rw-r--r-- 1 MY_NAME  197121 1062 10월 26  1985 LICENSE
drwxr-xr-x 1 MY_NAME  197121    0  2월 10 18:10 node_modules/
-rw-r--r-- 1 MY_NAME  197121 2195  2월 10 18:10 package.json
-rw-r--r-- 1 MY_NAME  197121 5905 10월 26  1985 README.md
drwxr-xr-x 1 MY_NAME  197121    0  2월 10 18:09 src/

So it invokes following error It must not be in distributed pacakge

Here is error log

C:\MY_DIR>npm install OTHER_PACAKGE
npm ERR! code EISGIT
npm ERR! path C:\MY_DIR\node_modules\serverless-plugin-optimize
npm ERR! git C:\MY_DIR\node_modules\serverless-plugin-optimize: Appears to be a git repo or submodule.
npm ERR! git C:\MY_DIR\serving\node_modules\serverless-plugin-optimize
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! C:\Users\USER_NAME\AppData\Roaming\npm-cache\_logs\2020-02-10T10_12_49_345Z-debug.log

env: windows 10 npm : 6.12.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
diogogvhenriquescommented, Feb 21, 2020

Hi @Mantisimo,

There is no updates … The last modification of this repository is 2month ago…

Would It better If I create PR to this?

Edit + npm document says as follows

By default, the following paths and files are ignored, so there’s no need to add them to .npmignore explicitly:

....
.git
....

https://docs.npmjs.com/using-npm/developers.html

Thanks for sharing this. So right now with this looks an issue from npm. We can do a PR to at least force the ignore .git

From what @Mantisimo this might also be a scenario of a symbolic link which looks outside of this package.

1reaction
Mantisimocommented, Feb 21, 2020

@Hwan-seok you could create a pr… i’ve found something else interesting… https://github.com/npm/npm-packlist/issues/50 Seems if you have a symbolic link dependency the .git directory could be included.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm install giving error while accessing GIT url - Stack Overflow
Your project depends upon a file css-flip which is stored in another project/repo. while installing npm, your package JSON file will try to ......
Read more >
[BUG] Failed to install npm package from git in docker since v6 ...
When I previously post log for issue I investigated the problem. This happens bacuase npm tries to clone ( git clone subprocess) in...
Read more >
Can't Read From Remote Git Repository During npm install
This happens when you list a git repository as a dependency in your package.json file. "<somepackage>": "git://github.com/someorg/somerepo.git".
Read more >
Common errors | npm Docs
It's most likely a temporary npm registry glitch. Check npm server status and try again later. If the error persists, perhaps the published...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
This error occurs because of the following reasons: ... package that is absent in your project directory – npm install package-name or yarn ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found