Closed yaroslavya closed 8 years ago
I'm away at the moment but @5id I think this might be your slice on @ for scoped packages?
One more detail: I tried it several times, by removing the repo and starting from scratch and it failed every time. But it fails on different @angular
packages. So its not @angular/platform-browser all the time
. Hope it helps :8ball:
I thought this might just be to do with scoped packages, but the following worked;
$ mkdir test
$ cd test
$ npm init -y
$ cat package.json
{
"name": "test",
"version": "1.0.0",
"dependencies": {
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"rxjs": "5.0.0-beta.6",
"zone.js": "0.6.12"
},
"keywords": [],
"license": "ISC",
"main": "index.js"
}
$ npm install
$ npm shrinkwrap --dev
$ shrinkpack
i 9 dependencies in npm-shrinkwrap.json
i 0 need removing from ./node_shrinkwrap
i 9 need adding to ./node_shrinkwrap
i 2 are in your npm cache
i 7 need downloading
i 0 have a missing "resolved" property
↓ @angular/common@2.0.0-rc.1 from http://registry.npmjs.org/@angular/common/-/common-2.0.0-rc.1.tgz
↓ @angular/compiler@2.0.0-rc.1 from http://registry.npmjs.org/@angular/compiler/-/compiler-2.0.0-rc.1.tgz
↓ @angular/core@2.0.0-rc.1 from http://registry.npmjs.org/@angular/core/-/core-2.0.0-rc.1.tgz
↓ @angular/http@2.0.0-rc.1 from http://registry.npmjs.org/@angular/http/-/http-2.0.0-rc.1.tgz
↓ @angular/platform-browser@2.0.0-rc.1 from http://registry.npmjs.org/@angular/platform-browser/-/platform-browser-2.0.0-rc.1.tgz
↓ @angular/platform-browser-dynamic@2.0.0-rc.1 from http://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-2.0.0-rc.1.tgz
↓ @angular/router@2.0.0-rc.1 from http://registry.npmjs.org/@angular/router/-/router-2.0.0-rc.1.tgz
+ @angular/platform-browser-dynamic@2.0.0-rc.1
+ zone.js@0.6.12
+ @angular/http@2.0.0-rc.1
+ @angular/router@2.0.0-rc.1
+ @angular/platform-browser@2.0.0-rc.1
+ @angular/common@2.0.0-rc.1
+ @angular/core@2.0.0-rc.1
+ @angular/compiler@2.0.0-rc.1
+ rxjs@5.0.0-beta.6
shrinkpack +9 -0 ↓7 ✓0 00:02
$ rm -rf node_modules
$ npm install
I will try to test the same on Windows.
Other things of note
file:node_shrinkwrap\\abbrev-1.0.9.tgz
.\
rather than /
– I wonder if npm
honours those in a shrinkwrap.Hey @yaroslavya, I ran the following on a windows vm and all worked fine, however, I just noticed your version of npm and I think that is the problem – it needs to be 3.10.4 or newer.
git clone https://github.com/preboot/angular2-webpack.git
cd angular2-webpack
npm install
npm shrinkwrap --dev
shrinkpack
rmdir /s /q node_modules/
npm install
Can you upgrade npm and see if that sorts it? Thanks.
I'm getting similar errors on npm@3.10.5
- am running on Ubuntu 14.04, with node@5.11.1
.
Mine involves scoped packages also (in our case; private packages, so I can't provide a reproduction case), and it also errors on different packages each time it's run.
It's not something like a request timeout or something is it?
edit Same error on npm@3.10.6
edit 2. Some investigation reveals the following lines in my (and the OP's) npm-shrinkwrap.json
:
"@domain-group/fe-helper": {
"version": "2.2.2",
"from": "@domain-group/fe-helper@>=2.2.0 <3.0.0",
"resolved": "http://registry.npmjs.org/@domain-group/fe-helper/-/fe-helper-2.2.2.tgz"
},
"@domain-group/fe-lint-scss": {
"version": "1.0.2",
"from": "@domain-group/fe-lint-scss@>=1.0.1 <2.0.0",
"resolved": "file:node_shrinkwrap/@domain-group-fe-lint-scss-1.0.2.tgz"
},
There are two different resolved
field protocols:
http://registry.npmjs.org/@domain-group/fe-helper/-/fe-helper-2.2.2.tgz
file:node_shrinkwrap/@domain-group-fe-lint-scss-1.0.2.tgz
The interesting part is the node_shrinkwrap
prefix - I'm not sure where this comes from as I am certain I don't have that local folder in my working directory.
edit 3:
Checking out the code, I can see it's attempting to run the following commands:
npm cache --scope=@domain-group add http://registry.npmjs.org/@domain-group/fe-helper/-/fe-helper-2.2.2.tgz
npm cache --scope=@domain-group add file:node_shrinkwrap/@domain-group-fe-lint-scss-1.0.2.tgz
But the folder node_shrinkwrap
doesn't exist, so the command fails (causing the original error).
edit 4: To clarify, the command I'm running is;
rm -rf npm-shrinkwrap.json && rm -rf node_modules && rm -rf node_shrinkwrap && npm install && npm shrinkwrap
I'm going to re-run that again but prefixed with a npm cache clear
to see if there's something funky going on there.
edit 5: A-ha! Running npm cache clear
fixed it. Going to try get a reproducable case together now.
I can't seem to reproduce the exact case above (where some fields in npm-shrinwrap.json
have a file:/
prefix), but this is very close:
git clone https://github.com/preboot/angular2-webpack.git
cd angular2-webpack
npm cache clear
npm install
npm shrinkwrap
shrinkpack
This succeeds. Note that the URLs for "resolved"
fields in the npm-shrinkwrap.json
are all http://
urls pointing to npmjs.org.
Now, run:
rm -rf node_shrinkwrap # (1)
shrinkpack
This fails. Note that at point (1)
, the URLs for "resolved"
fields in the npm-shrinkwrap.json
now begin with ./node_shrinkwrap
.
Maybe it will shed some light, but my very first installation and shrinkpack was successful. Then I`ve deleted the node_modules folder and had this error I reported. I didnt get a chance to try it out yet. Will do this weekend. Maybe the updated npm will work just fine on windows. I will also try to clear the cache, maybe it does the trick.
Similar problem here, I'm running the following commands:
(1) rm -rf ./node_modules && rm -f npm-shrinkwrap.json && npm cache clear && npm i && npm prune
(2) npm shrinkwrap --dev
fine and dandy till this point, then...
(3) rm -rf ./node_shrinkwrap && shrinkpack
here shrinkpack fails with this:
...
! failed to download aws4@1.4.1
! Please raise an issue at https://github.com/JamieMason/shrinkpack/issues
Error: Command failed: npm cache add https://lunabuild.akamai.com/nexus/content/groups/npm-all/aws4/-/aws4-1.4.1.tgz
npm ERR! fetch failed https://lunabuild.akamai.com/nexus/content/groups/npm-all/aws4/-/aws4-1.4.1.tgz
npm ERR! fetch failed https://lunabuild.akamai.com/nexus/content/groups/npm-all/aws4/-/aws4-1.4.1.tgz
npm ERR! fetch failed https://lunabuild.akamai.com/nexus/content/groups/npm-all/aws4/-/aws4-1.4.1.tgz
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "cache" "add" "https://lunabuild.akamai.com/nexus/content/groups/npm-all/aws4/-/aws4-1.4.1.tgz"
npm ERR! node v6.1.0
npm ERR! npm v3.8.6
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND lunabuild.akamai.com lunabuild.akamai.com:443
...
this is on OSX 10.11.5, see node and npm version above. these exact commands worked without a hitch for months till last week.
Thanks everyone, let's focus on https://github.com/preboot/angular2-webpack.git as that's a public repo we can all access and reproduce this issue with.
npm ERR! network getaddrinfo ENOTFOUND lunabuild.akamai.com lunabuild.akamai.com:443
npm install --loglevel http
on that repo produces this output angular2-webpack-loglevel-http.txt.npm shrinkwrap --dev
on that repo produces npm-shrinkwrap.json.txt."aws4": {
"version": "1.4.1",
"from": "aws4@>=1.2.1 <2.0.0",
"resolved": "https://lunabuild.akamai.com/nexus/content/groups/npm-all/aws4/-/aws4-1.4.1.tgz"
}
rm -rf node_modules
and npm install --loglevel http
to install from the npm-shrinkwrap.json
still doesn't include references to https://lunabuild.akamai.com (not sure why??).shrinkpack
at all.npm
doesn't seem to be using all of the entries in npm-shrinkwrap.json
, otherwise why wouldn't https://lunabuild.akamai.com ever be getting hit?shrinkpack
does use all of the entries in npm-shrinkwrap.json
if;
node_shrinkwrap
.~/.npm
.Q: Why would npm
not hit the URL defined in resolved
for a dependency in npm-shrinkwrap.json
?
@JamieMason I think the lunabuild.akamai.com
errors are actually new and different.
See https://github.com/strongloop/fsevents/issues/141
I believe this is a red herring masking the original issue that myself and @yaroslavya had.
Thanks @jesstelford, let's avoid angular2-webpack.git then in that case.
Would someone mind creating a reduced test case which reproduces the issue please? I'm pretty lost and the OP expectation of "shrinkpack should get the files from the node_modules folder and put them under the node_shrinkwrap folder" is too broad in it's description to narrow down what's needed.
Apologies if I'm missing something obvious here.
My problem seems to be solved by https://github.com/strongloop/fsevents/issues/141#issuecomment-233320756 👍
I didnt get a chance to try it out yet. Will do this weekend. Maybe the updated npm will work just fine on windows. I will also try to clear the cache, maybe it does the trick. – @yaroslavya
Could you let me know how this goes please Yaroslav?
@JamieMason Could not get to it yet. Will be able to check it out tomorrow and report the result here. Sorry for the delay.
No problem at all @yaroslavya
The npm version 3.10.5 worked just fine with preboot project. Didn't try the previous versions. Just in case anyone else has this problem I have a Windows 8 (didnt try it on win7 on which I had the initial issue). The issue was reproduced in absolutely the same way on win8. So I think that the latest npm version fixes it, so you can close it.
Thanks for looking into this for us @yaroslavya, appreciate it.
If reporting a bug, please use the following template.
Expected behaviour
shrinkpack should get the files from the node_modules folder and put them under the
node_shrinkwrap
folderActual behaviour
Steps to reproduce
Software versions used
Log output when running shrinkpack
Contents of your npm-shrinkwrap.json or package.json
yaroslavya-shrinkwrap.json.txt