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

Unable to resolve dependencies like "@angular/common" #399

Open
kukjevov opened this issue May 3, 2016 · 23 comments
Open

Unable to resolve dependencies like "@angular/common" #399

kukjevov opened this issue May 3, 2016 · 23 comments

Comments

@kukjevov
Copy link

kukjevov commented May 3, 2016

Hi,

Angular2 RC was released today and they have changed names of their packages so it looks like this.

"@angular/common": "2.0.0-rc.0",
"@angular/compiler": "2.0.0-rc.0",
"@angular/core": "2.0.0-rc.0",
"@angular/http": "2.0.0-rc.0",
"@angular/platform-browser": "2.0.0-rc.0",
"@angular/platform-browser-dynamic": "2.0.0-rc.0",
"@angular/router-deprecated": "2.0.0-rc.0",
"@angular/upgrade": "2.0.0-rc.0"

When using standard npm registry it works ok, but if using sinopia it will fail because of following error.
http <-- 404, user: username, req: 'GET /@angular%2fcommon', error: no such package available

That means sinopia can`t be used with angular2 RC.
Thank you for your help :)

@kukjevov
Copy link
Author

kukjevov commented May 3, 2016

Ok i changed configuration, because it was not using proxy setting but now there is an error.

http --> 404, req: 'GET http://registry.npmjs.org/%40angular%2Fcommon', bytes: 0/75
request to 'http://registry.npmjs.org/@angular%2Fcommon' works, but '@' character is url encoded which is causing problem

@kukjevov
Copy link
Author

kukjevov commented May 4, 2016

Ok as i see it this problem was fixed 13.7.2015, but last version published to npm was 7.6.2015 that means fix is not present in version that can be downloaded using npm.

If anyone has this problem, workaround for this is:
Option 1: in sinopia/lib/up-storage.js
change code on line number 10

var encode         = function(thing) {
  return encodeURIComponent(thing).replace(/^%40/, '@');
};

Option 2: set npm scoped registry to npmjs.org
npm config set "@angular:registry" http://registry.npmjs.org/

@adammartin1981
Copy link

adammartin1981 commented May 19, 2016

Do we know when/if this update will be pushed to npm?

(By the way thanks for the option 1 fix)

@BernhardRode
Copy link

Awesome, thanks for the fix.

+1 for: is it going to be pushed to npm?

@DanielYWoo
Copy link

+1 for: next release with this fix.

@themauveavenger
Copy link

I wouldn't count on a fix.. nothing has been published for 11 months. This project looks dead to me. Verdaccio is a fork of sinopia, but doesn't have anything published on npm yet.

https://github.com/verdaccio/verdaccio

@DanielYWoo
Copy link

The master branch works fine if you put a proxy for "@*" in the
config.yaml. However the npm version is a very old version.

On Fri, May 20, 2016 at 2:52 AM, themauveavenger [email protected]
wrote:

I wouldn't count on a fix.. nothing has been published for 11 months. This
project looks dead to me. Verdaccio is a fork of sinopia, but doesn't have
anything published on npm yet.

https://github.com/verdaccio/verdaccio


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#399 (comment)

Thanks & Regards,
Daniel

@tmichelis
Copy link

Hi,
sorry for bumbing the this, But I ran in the same issue. I went for option 1. up-storage.js look now like this:
var encode = function(thing) { return encodeURIComponent(thing).replace(/^%40/, '@'); };
Nonetheless I get the same error message:

http <-- 404, user: undefined, req: 'GET /@angular%2fcommon', error: no such package available

Does anyone have some more suggestions?

Cheers
Tobias

@kukjevov
Copy link
Author

Hi,
first you must update your config.yaml
section:

packages:
  '@*/*':
    # scoped packages
    access: $all
    publish: $authenticated
    proxy: npmjs

in default config.yaml there is no proxy setting.
Have a nice day

@tmichelis
Copy link

Hi,

thanks for your help. Now it works.

Cheers
Tobias

@isharajev
Copy link

Have the same issue. Waiting for fix )

@yanfali
Copy link

yanfali commented Jun 13, 2016

Had to patch my local docker instance using the replace trick above. Docker let's you patch individual files so I simply -v over the top of the up-storage.js with a version with the fix. If you are running this in a docker container, it's another way to fix the issue.

@opsxcq
Copy link

opsxcq commented Jun 23, 2016

+1

@MeirionHughes
Copy link

MeirionHughes commented Aug 12, 2016

Same... @rlidwka please publish or add some other maintainers.... this project has a massive following.

@kukjevov fixed for me... why that isn't in the default I don't know...

@gaelreyrol
Copy link

@kukjevov @MeirionHughes please see #376

@tmerse
Copy link

tmerse commented Aug 15, 2016

Could get it working by following this blogpost.

@cniweb
Copy link

cniweb commented Sep 27, 2016

We have the same problem with sonatype nexus as proxy repository.

C:\WKS\NodeJS\QuickStart>npm config list
; cli configs
user-agent = "npm/3.10.7 node/v6.5.0 win32 x64"

; userconfig C:\Users\ap284\.npmrc
@angular:registry = "http://nexus.lan.huk-coburg.de/content/repositories/npmjs/"
cache = "C:\\Lokal\\nodejs\\npm-cache"
registry = "http://nexus.lan.huk-coburg.de/content/repositories/npmjs/"

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\WKS\NodeJS\QuickStart
; HOME = C:\Users\ap284
; "npm config ls -l" to show all defaults.

@jaylu
Copy link

jaylu commented Dec 17, 2016

@cniweb , I met the same problem as you that 'with sonatype nexus as proxy repository', did you get that resolved yet ?

@cniweb
Copy link

cniweb commented Dec 20, 2016

@jaylu Yes, I use Nexus 3 now!

@decrypted
Copy link

You might need to check http://stackoverflow.com/questions/4390436/need-to-allow-encoded-slashes-on-apache

@yhjhoo
Copy link

yhjhoo commented Jul 22, 2017

use https://github.com/verdaccio/verdaccio and nenux solve my problem

@GonzaloLeyton
Copy link

@decrypted thanks, this solve my issue

@idrositis
Copy link

I had the same issue with Nexus 3.6.2, reverse-proxied by apache.
URLs like https://nexus.../repository/npm-group/@angular%2fhttp were returning 404.

@decrypted solved it with your suggestion:

eb2pr-app06:/etc/httpd/conf.d $ sudo /usr/bin/diff nexus.conf nexus.conf.20190123
33d32
<   AllowEncodedSlashes On
60d58
<   AllowEncodedSlashes On

Thanks!

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