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

Undocumented breaking change for scoped package config in npm@4 #14432

Closed
1 task done
billyjanitsch opened this issue Oct 26, 2016 · 1 comment
Closed
1 task done

Undocumented breaking change for scoped package config in npm@4 #14432

billyjanitsch opened this issue Oct 26, 2016 · 1 comment

Comments

@billyjanitsch
Copy link

billyjanitsch commented Oct 26, 2016

I'm opening this issue because:

  • npm is doing something I don't understand.

What's going wrong?

My ~/.npmrc contains a line to point packages under the @mycompany scope to our custom npme registry:

@mycompany:registry = "http://registry.mycompany.com/"

In npm@3, this config works correctly -- only @mycompany packages are routed through our registry. In npm@4, this line causes all requests to be routed through our registry. For example, if I run npm install react, I get:

npm ERR! Darwin 16.1.0
npm ERR! argv "/Users/billy/.nvm/versions/node/v7.0.0/bin/node" "/Users/billy/.nvm/versions/node/v7.0.0/bin/npm" "i" "react"
npm ERR! node v7.0.0
npm ERR! npm  v4.0.1
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on http://registry.mycompany.com/react
npm ERR! 404 
npm ERR! 404  'react' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Even adding registry=http://registry.npmjs.org/ to my ~/.npmrc doesn't fix the problem.

There is no mention of this change in the 4.0.0/4.0.1 release nodes, so I assume it's a regression.

How can the CLI team reproduce the problem?

Add the above scoped registry config to an .npmrc and try to install an unscoped package.

supporting information:

  • npm -v prints: 4.0.1
  • node -v prints: 7.0.0
  • npm config get registry prints: surprisingly, https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: macOS 10.12.1
@zkat
Copy link
Contributor

zkat commented Oct 26, 2016

This is a duplicate of #14412 and a regression caused by #14129.

@zkat zkat closed this as completed Oct 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants