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 Updates Fail Behind Proxy #1338

Closed
lewislambert opened this Issue Aug 19, 2013 · 3 comments

Comments

Projects
None yet
3 participants
@lewislambert

lewislambert commented Aug 19, 2013

I am currently working on a customer site where all traffic is transparently sent via their filtering proxy by the firewall and I am having failures whenever Meteor attempts to install the latest NPM dependencies within packages (core packages included).

I am running from the releases/0.6.5 tag and the developer bundle created from the scripts provided in the git repository as is documented.

Using NPM normally (The version shipped with Node on the development machine), we have no issues installing modules through the proxy as NPM is respecting the environment variables for the proxy configuration.

However, from what code I have had time to look through, Meteor is calling the NPM version within the dev bundle, which when I run ./dev_bundle/bin/npm config list, is also showing the proxy configuration is picked up from my ~/.npmrc file.

Does anyone know why when running NPM through Meteor, it is failing to download and install the modules and if there is a workaround in place at present?

My workaround at the moment is not a nice one. I am having to go into the packages/packagename/.npm/ directory, copy the npm-shrinkwrap.json file to package.json, run npm install, then remove the package.json file in order to install the dependencies.

Specific output from running Meteor
meteor test-packages
webapp: updating npm dependencies -- connect, send, useragent...
mongo-livedata: updating npm dependencies -- mongodb...
handlebars: updating npm dependencies -- handlebars...
compileCoffeescript: updating npm dependencies -- coffee-script, source-map...
email: updating npm dependencies -- mailcomposer, simplesmtp, stream-buffers...
star-translate: updating npm dependencies -- ncp...
compileLess: updating npm dependencies -- less...
compileStylus: updating npm dependencies -- stylus, nib...
ctl-helper: updating npm dependencies -- optimist...
minifiers: updating npm dependencies -- clean-css, uglify-js...
=> Errors while scanning packages:

While building package `webapp`:
error: Can't install npm dependencies. Are you connected to the internet?

While building package `mongo-livedata`:
error: Can't install npm dependencies. Are you connected to the internet?

While building package `handlebars`:
error: Can't install npm dependencies. Are you connected to the internet?

While building plugin `compileCoffeescript` in package `coffeescript`:
error: Can't install npm dependencies. Are you connected to the internet?

While loading plugin `compileCoffeescript` from package `coffeescript`:
module.js:338:15: Cannot find module 'coffee-script'
  at Function.Module._resolveFilename (module.js:338:15)
  at Function.Module._load (module.js:280:25)
  at Module.require (module.js:362:17)
  at require (module.js:378:17)
  at Object._.extend.load._.each._.extend.Npm.require (/root/meteor/tools/bundler.js:977:22)
  at Package (packages/compileCoffeescript/plugin/compile-coffeescript.js:3)
  at <runJavaScript-8>:171:4
  at <runJavaScript-8>:178:3

While building package `email`:
error: Can't install npm dependencies. Are you connected to the internet?

While building package `star-translate`:
error: Can't install npm dependencies. Are you connected to the internet?

While building plugin `compileLess` in package `less`:
error: Can't install npm dependencies. Are you connected to the internet?

While loading plugin `compileLess` from package `less`:
module.js:338:15: Cannot find module 'less'
  at Function.Module._resolveFilename (module.js:338:15)
  at Function.Module._load (module.js:280:25)
  at Module.require (module.js:362:17)
  at require (module.js:378:17)
  at Object._.extend.load._.each._.extend.Npm.require (/root/meteor/tools/bundler.js:977:22)
  at Package (packages/compileLess/plugin/compile-less.js:3)
  at <runJavaScript-9>:68:4
  at <runJavaScript-9>:75:3

While building plugin `compileStylus` in package `stylus`:
error: Can't install npm dependencies. Are you connected to the internet?

While loading plugin `compileStylus` from package `stylus`:
module.js:338:15: Cannot find module 'stylus'
  at Function.Module._resolveFilename (module.js:338:15)
  at Function.Module._load (module.js:280:25)
  at Module.require (module.js:362:17)
  at require (module.js:378:17)
  at Object._.extend.load._.each._.extend.Npm.require (/root/meteor/tools/bundler.js:977:22)
  at Package (packages/compileStylus/plugin/compile-stylus.js:2)
  at <runJavaScript-10>:48:4
  at <runJavaScript-10>:55:3

While building package `ctl-helper`:
error: Can't install npm dependencies. Are you connected to the internet?

While building package `minifiers`:
error: Can't install npm dependencies. Are you connected to the internet?
@glasser

This comment has been minimized.

Member

glasser commented Aug 19, 2013

Meteor checks that it can GET http://registry.npmjs.org before running NPM commands, to allow it to give this "are you connected" error message. The function we use in Meteor to do HTTP stuff doesn't currently work behind a proxy; see also #689 and #429. We don't have a timeline to fix this; maybe next bugs week.

@lewislambert

This comment has been minimized.

lewislambert commented Aug 20, 2013

I have modified the method locally to remove that connectivity checking call and everything works as expected. Now I know what the issue is, I will work on a pull request.

Thanks

@n1mmy

This comment has been minimized.

Member

n1mmy commented Sep 27, 2013

Http proxy support is now on devel (3177d9a)

@n1mmy n1mmy closed this Sep 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment