Bruce Whey
Bruce Whey

Reputation: 54

NPM is failing to install any scoped packages

I'm on Node v6.10.3 and NPM v3.8.6.

My issue is that I'm unable to install any scoped packages. Everything returns with a 404 Not Found.

Here's some examples to list:

2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData @angular/common@^4.1.2
8 silly fetchNamedPackageData @angular/common
9 silly mapToRegistry name @angular/common
10 silly mapToRegistry scope (from package name) @angular
11 verbose mapToRegistry no registry URL found in name for scope @angular
12 silly mapToRegistry using default registry
13 silly mapToRegistry registry http://registry.npmjs.org/
14 silly mapToRegistry data Result {
14 silly mapToRegistry   raw: '@angular/common',
14 silly mapToRegistry   scope: '@angular',
14 silly mapToRegistry   name: '@angular/common',
14 silly mapToRegistry   rawSpec: '',
14 silly mapToRegistry   spec: 'latest',
14 silly mapToRegistry   type: 'tag' }
15 silly mapToRegistry uri http://registry.npmjs.org/@angular%2fcommon
16 verbose request uri http://registry.npmjs.org/@angular%2fcommon
17 verbose request no auth needed
18 info attempt registry request try #1 at 4:58:49 PM
19 verbose request id cd941220750809c1
20 http request GET http://registry.npmjs.org/@angular%2fcommon
21 http 404 http://registry.npmjs.org/@angular%2fcommon
22 verbose headers { date: 'Thu, 22 Jun 2017 20:58:49 GMT',
22 verbose headers   'content-type': 'application/json',
22 verbose headers   'content-length': '21',
22 verbose headers   connection: 'keep-alive',
22 verbose headers   'cache-control': 'max-age=0',
22 verbose headers   'accept-ranges': 'bytes',
22 verbose headers   via: '1.1 varnish',
22 verbose headers   age: '0',
22 verbose headers   'x-served-by': 'cache-ord1732-ORD',
22 verbose headers   'x-cache': 'MISS',
22 verbose headers   'x-cache-hits': '0',
22 verbose headers   'x-timer': 'S1498165129.495392,VS0,VE389' }
23 silly get cb [ 404,
23 silly get   { date: 'Thu, 22 Jun 2017 20:58:49 GMT',
23 silly get     'content-type': 'application/json',
23 silly get     'content-length': '21',
23 silly get     connection: 'keep-alive',
23 silly get     'cache-control': 'max-age=0',
23 silly get     'accept-ranges': 'bytes',
23 silly get     via: '1.1 varnish',
23 silly get     age: '0',
23 silly get     'x-served-by': 'cache-ord1732-ORD',
23 silly get     'x-cache': 'MISS',
23 silly get     'x-cache-hits': '0',
23 silly get     'x-timer': 'S1498165129.495392,VS0,VE389' } ]
24 silly fetchPackageMetaData Error: Not found : @angular/common


1 verbose cli   'install',
1 verbose cli   '@types/jasmine' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData @types/[email protected]
8 silly fetchNamedPackageData @types/jasmine
9 silly mapToRegistry name @types/jasmine
10 silly mapToRegistry scope (from package name) @types
11 verbose mapToRegistry no registry URL found in name for scope @types
12 silly mapToRegistry using default registry
13 silly mapToRegistry registry http://registry.npmjs.org/
14 silly mapToRegistry data Result {
14 silly mapToRegistry   raw: '@types/jasmine',
14 silly mapToRegistry   scope: '@types',
14 silly mapToRegistry   name: '@types/jasmine',
14 silly mapToRegistry   rawSpec: '',
14 silly mapToRegistry   spec: 'latest',
14 silly mapToRegistry   type: 'tag' }
15 silly mapToRegistry uri http://registry.npmjs.org/@types%2fjasmine
16 verbose request uri http://registry.npmjs.org/@types%2fjasmine
17 verbose request no auth needed
18 info attempt registry request try #1 at 5:00:56 PM
19 verbose request id 7a34acc3581b3816
20 http request GET http://registry.npmjs.org/@types%2fjasmine
21 http 404 http://registry.npmjs.org/@types%2fjasmine
22 verbose headers { date: 'Thu, 22 Jun 2017 21:00:57 GMT',
22 verbose headers   'content-type': 'application/json',
22 verbose headers   'content-length': '2',
22 verbose headers   connection: 'keep-alive',
22 verbose headers   'cache-control': 'max-age=0',
22 verbose headers   'accept-ranges': 'bytes',
22 verbose headers   via: '1.1 varnish',
22 verbose headers   age: '0',
22 verbose headers   'x-served-by': 'cache-ord1729-ORD',
22 verbose headers   'x-cache': 'MISS',
22 verbose headers   'x-cache-hits': '0',
22 verbose headers   'x-timer': 'S1498165257.978535,VS0,VE139',
22 verbose headers   vary: 'Accept-Encoding' }
23 silly get cb [ 404,
23 silly get   { date: 'Thu, 22 Jun 2017 21:00:57 GMT',
23 silly get     'content-type': 'application/json',
23 silly get     'content-length': '2',
23 silly get     connection: 'keep-alive',
23 silly get     'cache-control': 'max-age=0',
23 silly get     'accept-ranges': 'bytes',
23 silly get     via: '1.1 varnish',
23 silly get     age: '0',
23 silly get     'x-served-by': 'cache-ord1729-ORD',
23 silly get     'x-cache': 'MISS',
23 silly get     'x-cache-hits': '0',
23 silly get     'x-timer': 'S1498165257.978535,VS0,VE139',
23 silly get     vary: 'Accept-Encoding' } ]
24 silly fetchPackageMetaData Error: Registry returned 404 for GET on http://registry.npmjs.org/@types%2fjasmine

So far, I've tried setting a registry on the scope (as shown below), changing npm versions, clearing the cache, and deleting the node modules.

npm config set @types:registry http://registry.npmjs.org/

So far nothing has worked. I feel like it may be some kind of encoding issue that occurs when npm tries to access scoped packages. I'm still able to install all unscoped packages.

Another thing, I've noticed is that this issue only occurs on the npmjs registry. I have another scoped registry set up for @progress (https://registry.npmjs.telerik.org), and I'm actually able to install packages from there.

Any advice or tip would be appreciated.

Upvotes: 1

Views: 2349

Answers (1)

Bruce Whey
Bruce Whey

Reputation: 54

Found out this was caused by my Company's proxy.

The redirection causes the escaped '/' to become un-escaped, so it was hitting https://registry.npmjs.org/@angular/core rather than https://registry.npmjs.org/@angular%2fcore

Upvotes: 1

Related Questions