Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npm private registry not working with npmrc file at the project level #2026

Closed
mribichich opened this issue Aug 12, 2016 · 3 comments
Closed

Comments

@mribichich
Copy link

Hi there, I have a npmrc file on my project level with a custom registry. Which doesn't need credentials to pull packages. With npm it works fine.

But when I try to jspm install it fails with err Repo npm:angular-img-fallback not found!

I've already tried jspm registry config npm but its the same.

I found a config file in ~/.jspm/config but the thing is, I dont want to config the registry for every project in my machine, just for those that have the npmrc file config in the project level.

thanks!

@guybedford
Copy link
Member

This may be related to jspm/npm#106.

@mribichich
Copy link
Author

The thing is that with npm it works just find with the .npmrc project file. In fact if a remove the .npmrc file from my project, and leave the scope with my registry with npm auth, it works just find with jspm for installing packages. My private registry doesn't require auth for reading, only for writing.

I wanted to config our work npm internal registry for work projects only. Thats why I was using the .npmrc project file, like this:

project/.npmrc

registry = http://xxx.xxx.xxx.xxx/repository/npm-all

But jspm can't find any package, with scope or not. My problem is not scopes, its any package install.

This is everything that I tested:

  • With an .npmrc project file it can't find any package. Even if I remove the ~/.npmrc file:

~/.jspm/config

// no change

~/.npmrc

//xxx.xxx.xxx.xxx/repository/:_authToken=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
@sis-presentismo:registry=http://xxx.xxx.xxx.xxx/repository/npm-all

project/.npmrc

registry = http://xxx.xxx.xxx.xxx/repository/npm-all
  • Without .npmrc file in my project, without changing jspm config and adding the scope config to ~/.npmrc, installing the scope works find and any package too.

~/.jspm/config

// no change

~/.npmrc

//xxx.xxx.xxx.xxx/repository/:_authToken=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
@sis-presentismo:registry=http://xxx.xxx.xxx.xxx/repository/npm-all

project/.npmrc

// nothing
  • If I change the .jspm config and add my registry to npm and token it doesnt work for any package, even if I remove the ~/.npmrc file:

~/.jspm/config

"npm": {
      "remote": "https://npm.jspm.io",
      "registry": "http://xxx.xxx.xxx.xxx/repository/npm-all",
      "authToken": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "handler": "jspm-npm"
    },

~/.npmrc

//xxx.xxx.xxx.xxx/repository/:_authToken=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
@sis-presentismo:registry=http://xxx.xxx.xxx.xxx/repository/npm-all

project/.npmrc

// nothing
  • With a custom npm registry, adding my private registry, it works if I jspm install tss-npm:angular and all the npm installs works too but from npm registry:

~/.jspm/config

"npm": {
      "remote": "https://npm.jspm.io",
      "handler": "jspm-npm"
    },

"tss-npm": {
      "remote": "https://npm.jspm.io",
      "registry": "http://xxx.xxx.xxx.xxx/repository/npm-all",
      "authToken": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "handler": "jspm-npm"
    },

~/.npmrc

//xxx.xxx.xxx.xxx/repository/:_authToken=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
@sis-presentismo:registry=http://xxx.xxx.xxx.xxx/repository/npm-all

project/.npmrc

// nothing

I think its weird that creating a custom npm registry works fine, but if I copy the same lines to the npm registry, it doesnt work.

Thanks!

@guybedford
Copy link
Member

Contributions very welcome here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants