sinopia icon indicating copy to clipboard operation
sinopia copied to clipboard

Unable to resolve dependencies like "@angular/common"

Open kukjevov opened this issue 8 years ago • 23 comments

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 avatar May 03 '16 08:05 kukjevov

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 avatar May 03 '16 08:05 kukjevov

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/

kukjevov avatar May 04 '16 06:05 kukjevov

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

(By the way thanks for the option 1 fix)

adammartin1981 avatar May 19 '16 11:05 adammartin1981

Awesome, thanks for the fix.

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

BernhardRode avatar May 19 '16 13:05 BernhardRode

+1 for: next release with this fix.

DanielYWoo avatar May 19 '16 13:05 DanielYWoo

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

themauveavenger avatar May 19 '16 18:05 themauveavenger

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 https://github.com/rlidwka/sinopia/issues/399#issuecomment-220417013

Thanks & Regards, Daniel

DanielYWoo avatar May 23 '16 01:05 DanielYWoo

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

tmichelis avatar May 31 '16 08:05 tmichelis

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

kukjevov avatar May 31 '16 08:05 kukjevov

Hi,

thanks for your help. Now it works.

Cheers Tobias

tmichelis avatar May 31 '16 08:05 tmichelis

Have the same issue. Waiting for fix )

isharajev avatar Jun 09 '16 13:06 isharajev

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.

yanfali avatar Jun 13 '16 23:06 yanfali

+1

opsxcq avatar Jun 23 '16 00:06 opsxcq

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...

MeirionHughes avatar Aug 12 '16 10:08 MeirionHughes

@kukjevov @MeirionHughes please see #376

gaelreyrol avatar Aug 12 '16 12:08 gaelreyrol

Could get it working by following this blogpost.

tmerse avatar Aug 15 '16 13:08 tmerse

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.

cniweb avatar Sep 27 '16 12:09 cniweb

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

jaylu avatar Dec 17 '16 14:12 jaylu

@jaylu Yes, I use Nexus 3 now!

cniweb avatar Dec 20 '16 23:12 cniweb

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

decrypted avatar Apr 18 '17 15:04 decrypted

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

yhjhoo avatar Jul 22 '17 10:07 yhjhoo

@decrypted thanks, this solve my issue

GonzaloLeyton avatar Jan 02 '18 18:01 GonzaloLeyton

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!

idrositis avatar Jan 23 '19 12:01 idrositis