This repository has been archived by the owner. It is now read-only.

npm install --save with a git dependency saves a relative path to tmp/ #7121

Closed
aearly opened this Issue Jan 12, 2015 · 18 comments

Comments

Projects
None yet
8 participants
@aearly

aearly commented Jan 12, 2015

aearly@alpha:~/projects/some-project
$ npm --version
2.2.0

aearly@alpha:~/projects/some-project
$ npm i git://github.com/aearly/somemodule --save
somemodule@0.1.0 node_modules/somemodule

aearly@alpha:~/projects/some-project
$ grep somemodule package.json 
    "somemodule": "file:../../../../tmp/npm-10362-85236a5e/1421102722335-0.624850605847314/b1567b5b2223729d0a4fe3d82513241e6e1035df",

Prior to NPM 2.0, this would have saved as:

    "somemodule": "git://github.com/aearly/somemodule",

It works as expected if I use the aearly/somemodule shorthand.

@smikes

This comment has been minimized.

Show comment
Hide comment
@smikes

smikes Jan 13, 2015

Contributor

Thanks for the bug report!

/cc @othiym23 bug report

Contributor

smikes commented Jan 13, 2015

Thanks for the bug report!

/cc @othiym23 bug report

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Jan 17, 2015

Contributor

Confirmed. Thanks for the report! This needs both a patch and a regression test, because I'm sure my recent meddling with git caching to fix things is responsible for this, but none of the relevant tests caught it.

Contributor

othiym23 commented Jan 17, 2015

Confirmed. Thanks for the report! This needs both a patch and a regression test, because I'm sure my recent meddling with git caching to fix things is responsible for this, but none of the relevant tests caught it.

@KidkArolis

This comment has been minimized.

Show comment
Hide comment
@KidkArolis

KidkArolis Jan 28, 2015

Contributor

Is there already an issue filed about tmp folders being put into the shrinkwrap (has been happening since npm >2.1.4):

    "cookieman": {
       "version": "0.0.0",
       "from": "../../../../../var/folders/hf/nd46_7jd41zd1g1bgymsl1rw0000gn/T/npm-31235-4b3b79e1/git-cache-2c0066f6ed57/9f1b66bdc0460c86e5d72cfe66b210422826f877",
       "resolved": "git+ssh://git@github.com:cookieman/cookieman.git#9f1b66bdc0460c86e5d72cfe66b210422826f877"
     }
Contributor

KidkArolis commented Jan 28, 2015

Is there already an issue filed about tmp folders being put into the shrinkwrap (has been happening since npm >2.1.4):

    "cookieman": {
       "version": "0.0.0",
       "from": "../../../../../var/folders/hf/nd46_7jd41zd1g1bgymsl1rw0000gn/T/npm-31235-4b3b79e1/git-cache-2c0066f6ed57/9f1b66bdc0460c86e5d72cfe66b210422826f877",
       "resolved": "git+ssh://git@github.com:cookieman/cookieman.git#9f1b66bdc0460c86e5d72cfe66b210422826f877"
     }
@KidkArolis

This comment has been minimized.

Show comment
Hide comment
@KidkArolis

KidkArolis Jan 28, 2015

Contributor

Ah, I can see this is related to how git deps are installed.. (the installed package.json contains incorrect "_from" which must break the shrinkwrap)

Contributor

KidkArolis commented Jan 28, 2015

Ah, I can see this is related to how git deps are installed.. (the installed package.json contains incorrect "_from" which must break the shrinkwrap)

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Feb 11, 2015

I would be so happy to see this fixed!

gaearon commented Feb 11, 2015

I would be so happy to see this fixed!

@aredridel

This comment has been minimized.

Show comment
Hide comment
@aredridel

aredridel Feb 11, 2015

Contributor

Likewise! this bit me and I forgot to report it!

Contributor

aredridel commented Feb 11, 2015

Likewise! this bit me and I forgot to report it!

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Feb 11, 2015

Contributor

See #7296 for a fix for this, which may or may not land this week.

Contributor

othiym23 commented Feb 11, 2015

See #7296 for a fix for this, which may or may not land this week.

@smikes

This comment has been minimized.

Show comment
Hide comment
@smikes

smikes Feb 28, 2015

Contributor

Did this get fixed as part of npm@2.7.0?

Contributor

smikes commented Feb 28, 2015

Did this get fixed as part of npm@2.7.0?

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Mar 4, 2015

Contributor

@smikes I don't know / don't think so. They turned out to be fairly different issues.

Contributor

othiym23 commented Mar 4, 2015

@smikes I don't know / don't think so. They turned out to be fairly different issues.

@KidkArolis

This comment has been minimized.

Show comment
Hide comment
@KidkArolis

KidkArolis Mar 4, 2015

Contributor

:(

This issue (I think it's this issue) breaks all npm+git+shrinkwrap usage. It's preventing my team and me from upgrading to anything above npm 2.1.4.

Not complaining - just letting you know ;)

I'll try to take a closer look at whether this is resolved in 2.7.0 and see if I can fix it..

Contributor

KidkArolis commented Mar 4, 2015

:(

This issue (I think it's this issue) breaks all npm+git+shrinkwrap usage. It's preventing my team and me from upgrading to anything above npm 2.1.4.

Not complaining - just letting you know ;)

I'll try to take a closer look at whether this is resolved in 2.7.0 and see if I can fix it..

@KidkArolis

This comment has been minimized.

Show comment
Hide comment
@KidkArolis

KidkArolis Mar 4, 2015

Contributor

I can confirm the issue still happens in 2.7.0.

Steps to reproduce

$ mkdir foo
$ cd foo
$ npm init
$ npm install --save git+ssh://git@github.com:QubitProducts/pkguid

package.json contains:

{
  ...
  "dependencies": {
    "pkguid": "file:../../../../../../var/folders/hf/nd46_7jd41zd1g1bgymsl1rw0000gn/T/npm-18964-1b8d06aa/git-cache-10aa7514779c/894f50939c7626c6d3d61ff33faa71155290bcf4"
  }
}

This also affects node_modules/pkguid/package.json#_from as well as npm shrinkwrap.

Contributor

KidkArolis commented Mar 4, 2015

I can confirm the issue still happens in 2.7.0.

Steps to reproduce

$ mkdir foo
$ cd foo
$ npm init
$ npm install --save git+ssh://git@github.com:QubitProducts/pkguid

package.json contains:

{
  ...
  "dependencies": {
    "pkguid": "file:../../../../../../var/folders/hf/nd46_7jd41zd1g1bgymsl1rw0000gn/T/npm-18964-1b8d06aa/git-cache-10aa7514779c/894f50939c7626c6d3d61ff33faa71155290bcf4"
  }
}

This also affects node_modules/pkguid/package.json#_from as well as npm shrinkwrap.

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Mar 4, 2015

Contributor

This also needs to get fixed soon to unblock shrinkwrap users, so I will look at getting this into this week's release.

Contributor

othiym23 commented Mar 4, 2015

This also needs to get fixed soon to unblock shrinkwrap users, so I will look at getting this into this week's release.

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Mar 5, 2015

Contributor

There is a fix in #7539; it got kind of messy because I realized that lib/cache/add-remote-git.js had become a disaster area and I no longer really understood how the whole thing worked. This will be included in this week's release. Feel free to review the PR if you like.

Contributor

othiym23 commented Mar 5, 2015

There is a fix in #7539; it got kind of messy because I realized that lib/cache/add-remote-git.js had become a disaster area and I no longer really understood how the whole thing worked. This will be included in this week's release. Feel free to review the PR if you like.

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Mar 5, 2015

Contributor

This is finally fixed in 6823807. With any luck, I a. didn't introduce any new regressions and b. have made it less likely that things will go wrong with caching git remotes in the future. Thanks to everyone for their patience.

Contributor

othiym23 commented Mar 5, 2015

This is finally fixed in 6823807. With any luck, I a. didn't introduce any new regressions and b. have made it less likely that things will go wrong with caching git remotes in the future. Thanks to everyone for their patience.

@othiym23 othiym23 closed this Mar 5, 2015

@KidkArolis

This comment has been minimized.

Show comment
Hide comment
@KidkArolis

KidkArolis Mar 5, 2015

Contributor

❤️

Contributor

KidkArolis commented Mar 5, 2015

❤️

@aearly

This comment has been minimized.

Show comment
Hide comment
@aearly

aearly Mar 5, 2015

🎠 🌈 💫

aearly commented Mar 5, 2015

🎠 🌈 💫

@lxe

This comment has been minimized.

Show comment
Hide comment
@lxe

lxe Mar 23, 2015

Contributor

Contributor

lxe commented Mar 23, 2015

@imsaar

This comment has been minimized.

Show comment
Hide comment
@imsaar

imsaar Jun 4, 2015

I just ran into this issue and I upgraded to npm 2.11.0 (from 2.7.0) and it is now resolved.

Just do npm install npm -g
And shrinkwrap again

imsaar commented Jun 4, 2015

I just ran into this issue and I upgraded to npm 2.11.0 (from 2.7.0) and it is now resolved.

Just do npm install npm -g
And shrinkwrap again

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