Skip to content
New issue

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

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

Already on GitHub? # to your account

Can't install when behind an npm proxy such as Nexus or Artifactory #706

Closed
timothydowney opened this issue Nov 11, 2015 · 24 comments
Closed

Comments

@timothydowney
Copy link

Hi,

I'm encountering problems with @reactivex/rxjs that originated when trying to install angular2. I'm currently using a local Nexus as an npm proxy repository and encountering problems when trying to npm install reactivex. Searching around shows what appears to be another person with the same problem behind an Artifactory. I can't tell if it is a Nexus/Artifactory bug around the @ sign or something else.

Anyhow, I'm hoping that someone can shed some light on it in case others are seeing it.

I am able to install when I don't use my Nexus proxy.

Here's the error:

54 downeyt:~/tmp $ npm install @reactivex/rxjs
npm ERR! registry error parsing json
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/bin/npm" "install" "@reactivex/rxjs"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.9

npm ERR! Unexpected token <
npm ERR! <html>
npm ERR!   <head>
npm ERR!     <title>404 - Path /@reactivex/rxjs not found in group repository &quot;npm&quot;     [id=npm].</title>
npm ERR!     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
npm ERR!
npm ERR!     <link rel="icon" type="image/png" href="http://mynexusurl:8081/nexus/c/favicon.png">
npm ERR!     <!--[if IE]>
npm ERR!     <link rel="SHORTCUT ICON" href="http://mynexusurl:8081/nexus/c/favicon.ico"/>
npm ERR!     <![endif]-->
npm ERR!
npm ERR!     <link rel="stylesheet" href="http://mynexusurl:8081/nexus/c/static/css/Sonatype-content.css?2.11.4-01" type="text/css"     media="screen" title="no title" charset="utf-8">
npm ERR!   </head>
npm ERR!   <body>
npm ERR!     <h1>404 - Path /@reactivex/rxjs not found in group repository &quot;npm&quot; [id=npm].</h1>
npm ERR!     <p>Path /@reactivex/rxjs not found in group repository &quot;npm&quot; [id=npm].</p>
npm ERR!   </body>
npm ERR! </html>
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/downeyt/tmp/npm-debug.log
755 downeyt:~/tmp $
@kwonoj
Copy link
Member

kwonoj commented Nov 11, 2015

May I possibly ask what's version of Nexus?

@timothydowney
Copy link
Author

Sonatype Nexus 2.11.4-01

@kwonoj
Copy link
Member

kwonoj commented Nov 11, 2015

I could see scoped npm package support on Nexus is implemented in Nexus 3 Milestone 6. Maybe this is reason of failure? Is it possible to isolate with updates Nexus?

@timothydowney
Copy link
Author

Hmmm...that looks like it could be the culprit. I'm not sure what you mean with the last sentence. Are you asking if I can try with Nexus 3 Milestone 6? I may be able to, but I'll need to set up a sandbox for that.

@kwonoj
Copy link
Member

kwonoj commented Nov 11, 2015

if I can try with Nexus 3 Milestone 6?

Yes, exactly. If that can be verified, we'll know for sure it's related with Nexus.

@timothydowney
Copy link
Author

Ok....looks like M6 came out today. If I wait a day or so, there may be Docker support which would make it really easy to try out. I'll grab it and run a test once I'm able to get M6.

@timothydowney
Copy link
Author

Ok, thank you Docker. I got a 3.0 M6 docker container. Still doesn't work for angular2. Just to be safe, I was able to use the 3.0M6 to successfully install things like phantomjs and angular.

69 downeyt:~/tmp $ npm install angular2
npm ERR! registry error parsing json
npm WARN install Couldn't install optional dependency: Unexpected token <
npm WARN install <html>
npm WARN install <head>
npm WARN install   <title>404 - Sonatype Nexus</title>
npm WARN install   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
npm WARN install
npm WARN install   <link rel="icon" type="image/png" href="http://192.168.99.100:8081/favicon.png$?3.0.0-b2015110601">
npm WARN install   <!--[if IE]>
npm WARN install   <link rel="SHORTCUT ICON" href="http://192.168.99.100:8081/favicon.ico?3.0.0-b2015110601"/>
npm WARN install   <![endif]-->
npm WARN install
npm WARN install   <link rel="stylesheet" type="text/css"     href="http://192.168.99.100:8081/static/css/nexus-content.css?3.0.0-b2015110601"/>
npm WARN install </head>
npm WARN install <body>
npm WARN install <div class="nexus-header">
npm WARN install   <a href="http://192.168.99.100:8081">
npm WARN install     <img src="http://192.168.99.100:8081/static/images/nexus.png?3.0.0-b2015110601"/>
npm WARN install     <span class="name">Sonatype Nexus</span>
npm WARN install   </a>
npm WARN install   <span class="version">OSS 3.0.0-b2015110601</span>
npm WARN install </div>
npm WARN install
npm WARN install <div class="nexus-body">
npm WARN install   <div class="content-header">
npm WARN install     <img src="http://192.168.99.100:8081/static/rapture/resources/icons/x32/exclamation.png?3.0.0-b2015110601"/>
npm WARN install     <span class="title">Error 404</span>
npm WARN install     <span class="description">Not Found</span>
npm WARN install   </div>
npm WARN install   <div class="content-body">
npm WARN install     <div class="content-section">
npm WARN install       Not Found
npm WARN install     </div>
npm WARN install       </div>
npm WARN install </div>
npm WARN install </body>
npm WARN install </html>
npm WARN install
npm WARN install

@kwonoj
Copy link
Member

kwonoj commented Nov 12, 2015

Thanks for taking time for tryout. Hoped version upgrade resolves issues :)

It seems now error logs are somewhat different than original, not sure which dependency of angular 2 is hitting. Would you mind to check if installing RxJS itself directly to see scoped package is actually resolved?

Meanwhile I'll give a shot with those container, expect it'll take some time though.

@freeranger
Copy link

Hi, I too am having a similar problem - behind a proxy, using Nexus - but an older version that isn't likely to be upgraded soon :/
Is it possibly to get a built package anywhere?
I tried downloading the git repo and npm installing that, but then get stuck because it is trying to build:

> @reactivex/rxjs@5.0.0-alpha.10 build_closure c:\UBS\Dev\RxJS-master
> java -jar ./node_modules/google-closure-compiler/compiler.jar ./dist/global/Rx.js --create_source_map ./dist/global/Rx.min.js.map --js_output_file ./dist/global/Rx.min.js

Unable to access jarfile ./node_modules/google-closure-compiler/compiler.jar

ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\\UBS\\Dev\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build_closure"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.9
npm ERR! code ELIFECYCLE
npm ERR! @reactivex/rxjs@5.0.0-alpha.10 build_closure: `java -jar ./node_modules/google-closure-compiler/compiler.jar ./dist/global/Rx.js --create_source_map ./dist/global/Rx.min.js.map --js_output_file ./dist/global/Rx.min.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @reactivex/rxjs@5.0.0-alpha.10 build_closure script 'java -jar ./node_modules/google-closure-compiler/compiler.jar ./dist/global/Rx.js --create_source_map ./dist/global/Rx.min.js.map --js_output_file ./dist/global/Rx.min.js'.
npm ERR! This is most likely a problem with the @reactivex/rxjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     java -jar ./node_modules/google-closure-compiler/compiler.jar ./dist/global/Rx.js --create_source_map ./dist/global/Rx.min.js.map --js_output_file ./dist/global/Rx.min.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls @reactivex/rxjs
npm ERR! There is likely additional logging output above.
-
npm ERR! Please include the following file with any support request:
npm ERR!     c:\UBS\Dev\RxJS-master\npm-debug.log

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\\UBS\\Dev\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build_global"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.9
npm ERR! code ELIFECYCLE
npm ERR! @reactivex/rxjs@5.0.0-alpha.10 build_global: `rm -rf dist/global && mkdir "dist/global" && browserify src/Rx.global.js --outfile dist/global/Rx.js && npm run build_closure`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @reactivex/rxjs@5.0.0-alpha.10 build_global script 'rm -rf dist/global && mkdir "dist/global" && browserifysrc/Rx.global.js --outfile dist/global/Rx.js && npm run build_closure'.
npm ERR! This is most likely a problem with the @reactivex/rxjs package,

@kwonoj
Copy link
Member

kwonoj commented Nov 13, 2015

@freeranger , those error message seems closure compiler cannot be found. RxJS package.json has dependency to those, would you able to check if those module's placed?

@benlesh
Copy link
Member

benlesh commented Nov 13, 2015

@freeranger I've had similar issues at companies I've worked with that had archaic proxies. Sometimes they blocked downloading packages that had jar files or other binaries. Sometimes they just blocked certain ports that were required for install. What I generally ended up doing is downloading a zip of the missing packages and installing them manually, and/or installing them while I wasn't behind the proxy. It sucks, but so do older proxies :). I appreciate your interest in contributing, and I really wish I had a better solution. You might just go look and see what it takes to manually install closure compiler.

@freeranger
Copy link

Hi,

Our CI builds are done using Team City on any number of agent machines. The agent machines cannot require manual setup, but the build can of course do npm install's and we can provide folders of stuff to reference if need be, so if there was an already built version out there or a way to download the npm package (which would not cause it to try to build) which I could then stick in a folder then that would work.

I did an "npm install google-closure-compiler" (I also have it installed globally "just incase". I can see it is in the node_modules folder and has the compiler.jar file there, but it still fails when I try to npm install rxjs from a folder:

> @reactivex/rxjs@5.0.0-alpha.10 build_global C:\UBS\Dev\RxJS-master
> rm -rf dist/global && mkdir "dist/global" && browserify src/Rx.global.js --outfile dist/global/Rx.js && npm run build_closure

\
> @reactivex/rxjs@5.0.0-alpha.10 build_closure C:\UBS\Dev\RxJS-master
> java -jar ./node_modules/google-closure-compiler/compiler.jar ./dist/global/Rx.js --create_source_map ./dist/global/Rx.min.js.map --js_output_file ./dist/global/Rx.min.js

Unable to access jarfile ./node_modules/google-closure-compiler/compiler.jar
/
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\\UBS\\Dev\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build_closure"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.9
npm ERR! code ELIFECYCLE
npm ERR! @reactivex/rxjs@5.0.0-alpha.10 build_closure: `java -jar ./node_modules/google-closure-compiler/compiler.jar ./dist/global /Rx.js --create_source_map ./dist/global/Rx.min.js.map --js_output_file ./dist/global/Rx.min.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @reactivex/rxjs@5.0.0-alpha.10 build_closure script 'java -jar ./node_modules/google-closure-compiler/compiler.jar ./dist/global/Rx.js --create_source_map ./dist/global/Rx.min.js.map --js_output_file ./dist/global/Rx.min.js'.
npm ERR! This is most likely a problem with the @reactivex/rxjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     java -jar ./node_modules/google-closure-compiler/compiler.jar ./dist/global/Rx.js --create_source_map ./dist/global/Rx.min.js.map --js_output_file ./dist/global/Rx.min.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls @reactivex/rxjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\UBS\Dev\RxJS-master\npm-debug.log
|
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\\UBS\\Dev\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build_global"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.9
npm ERR! code ELIFECYCLE
npm ERR! @reactivex/rxjs@5.0.0-alpha.10 build_global: `rm -rf dist/global && mkdir "dist/global" && browserify src/Rx.global.js --outfile dist/global/Rx.js && npm run build_closure`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @reactivex/rxjs@5.0.0-alpha.10 build_global script 'rm -rf dist/global && mkdir "dist/global" && browserify src/Rx.global.js --outfile dist/global/Rx.js && npm run build_closure'.
npm ERR! This is most likely a problem with the @reactivex/rxjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rm -rf dist/global && mkdir "dist/global" && browserify src/Rx.global.js --outfile dist/global/Rx.js && npm run build_closure
npm ERR! You can get their info via:
npm ERR!     npm owner ls @reactivex/rxjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\UBS\Dev\RxJS-master\npm-debug.log
\
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\\UBS\\Dev\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build_all"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.9
npm ERR! code ELIFECYCLE
npm ERR! @reactivex/rxjs@5.0.0-alpha.10 build_all: `npm run build_es6 && npm run build_amd && npm run build_cjs && npm run build_global`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @reactivex/rxjs@5.0.0-alpha.10 build_all script 'npm run build_es6 && npm run build_amd && npm run build_cjs && npm run build_global'.
npm ERR! This is most likely a problem with the @reactivex/rxjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build_es6 && npm run build_amd && npm run build_cjs && npm run build_global
npm ERR! You can get their info via:
npm ERR!     npm owner ls @reactivex/rxjs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\UBS\Dev\RxJS-master\npm-debug.log

npm ERR! addLocalDirectory Could not pack "C:\\UBS\\Dev\\RxJS-master" to "C:\\ubs\\dev\\npm-cache\\@reactivex\\rxjs\\5.0.0-alpha.10\\package.tgz"

@benlesh
Copy link
Member

benlesh commented Nov 16, 2015

@freeranger out of curiousity, why are you building this project in your own CI environment?

@freeranger
Copy link

I don't want to build it, believe me! I just want to use it but nexus, or at least the version we have to use, does not support scoped packages so I grabbed a zip of the repo and did an npm install pointing to the folder I unzipped to, and it tried to build.
If there's a way to get a pre build package then I'm more than happy with that!

@benlesh
Copy link
Member

benlesh commented Nov 16, 2015

@freeranger I see.

You could always just download it from the CDN: http://npmcdn.com/@reactivex/rxjs@5.0.0-alpha.10/dist/global/Rx.js

@freeranger
Copy link

Unfortunately it's not that simple - I am trying to use ng-Forward which has a dependency on @reactivex/rxjs so I need an npm installed reactivex/rxjs to satisfy it's requirements :/

@DHainzl-Seekda
Copy link

It seems to be an issue with the "/" in the path name which is not correctly escaped by Nexus and not and ReactiveX issue.
It looks like it will be fixed in the next milestone (Milestone 7) of Nexus 3 ... https://issues.sonatype.org/browse/NEXUS-9452

My solution was to temporarily disable the custom registry url in my .npmrc, and as I currently only use it for testing it was a viable option, but if you want to use it in production I don't have an idea, either ...

@benlesh
Copy link
Member

benlesh commented Dec 7, 2015

I don't want to build it, believe me! I just want to use it but nexus, or at least the version we have to use, does not support scoped packages

@freeranger: As of right now you can install either the CommonJS or the ES6 versions of this library with npm install rxjs or npm install rxjs-es respectively.

@timothydowney does the above also resolve your issues?

@scottsilvi
Copy link

Came across this after trying to install ng-2. Just had to comment out the registry in my .npmrc, and also set always-auth to false instead of true. Installed ng-2, with reactivex/rxjs, unapplied my changes to .npmrc, and was off & running.

@benlesh
Copy link
Member

benlesh commented Jan 15, 2016

Okay, since this issue has fallen stale, I'm going to close it.

@benlesh benlesh closed this as completed Jan 15, 2016
@redtony
Copy link

redtony commented Jan 15, 2016

Sorry I didn't see your previous comment. I am trying to use ng-Forward which has a dependency on @reactivex/rxjs so I need an npm installed reactivex/rxjs to satisfy it's requirements - no other variation will do. I am not in control of ngForward so I can't change its dependencies

@kwonoj
Copy link
Member

kwonoj commented Jan 15, 2016

@redtony , seems ng-forward has plans to upgrade dependency not to use scoped package. (ngUpgraders/ng-forward#122 (comment)) Will this be resolution for your problem? (though you may need wait bit and update ng-forward accordingly)

@redtony
Copy link

redtony commented Jan 15, 2016

@kwonoj yes thanks, good spot!

@lock
Copy link

lock bot commented Jun 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants