Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm install --no-registry does not work with cache #3691

Closed
bbaia opened this issue Jul 24, 2013 · 18 comments
Closed

npm install --no-registry does not work with cache #3691

bbaia opened this issue Jul 24, 2013 · 18 comments
Labels
Milestone

Comments

@bbaia
Copy link

bbaia commented Jul 24, 2013

I'm trying to setup an offline build server with nodejs and grunt-cli but I can't make it work with cache and --no-registry option.

I was expecting this to work:

npm cache add abbrev-1.0.4.tgz
npm cache add nopt-1.0.10.tgz
npm cache add lru-cache-2.3.0.tgz
npm cache add sigmund-1.0.0.tgz
npm cache add minimatch-0.2.12.tgz
npm cache add graceful-fs-1.2.3.tgz
npm cache add inherits-1.0.0.tgz
npm cache add glob-3.1.21.tgz
npm cache add lodash-1.0.1.tgz
npm cache add findup-sync-0.1.2.tgz
npm cache add resolve-0.3.1.tgz
npm install -g grunt-cli-0.1.9.tgz --no-registry

got an error on npm install: "No registry url provided: GET nopt".

Note that no '.cache.json' have been generated since I have a fresh install of nodejs for windows.

@khalsah
Copy link

khalsah commented Nov 13, 2013

Anyone have any idea why this doesn't work or how to get it working? I'm trying to avoid depending on the npm registry for deployment (what with all the downtime) and just when I though I'd found a workable solution for my situation I ran into the "No registry url provided" error.

@luk-
Copy link
Contributor

luk- commented Nov 13, 2013

--no-registry is still broken, reopening #2568.

@luk- luk- closed this as completed Nov 13, 2013
@luk-
Copy link
Contributor

luk- commented Nov 13, 2013

@khalsah if you want, you can set the cache-min config to a really large value to always install from your cache if something exists:

npm config set cache-min 100000000

@robertkowalski
Copy link
Contributor

sorry, but were not able to reproduce this, works for me.

but the right usage to add something to the cache is:

$ npm cache add nopt@1.0.10

@robertkowalski
Copy link
Contributor

@bbaia can i get a short feedback if that solves your issue?

@bbaia
Copy link
Author

bbaia commented Nov 15, 2013

$ npm cache add nopt@1.0.10 requires a connection. How can this resolve my issue?

@bbaia
Copy link
Author

bbaia commented Nov 15, 2013

Looks like .cache.json is important here:

$ npm cache add nopt@1.0.10 creates a .cache.json file
$ npm cache add nopt-1.0.10.tgz does not create a .cache.json file

@robertkowalski
Copy link
Contributor

@bbaia what is your npm version? i am asking because of https://github.com/isaacs/npm/issues/1738#issuecomment-26885594 - the comment by @tomyan

@bbaia
Copy link
Author

bbaia commented Nov 15, 2013

I'm using node@0.10.13, I'll update to latest version and test it monday.
Stay tuned.

@bbaia
Copy link
Author

bbaia commented Nov 19, 2013

Still fail with No registry url provided
Using npm v1.3.14 on Windows

@mikermcneil
Copy link

--no-registry also fails for me

npm -v
1.3.17

@mikermcneil
Copy link

I guess I should say "how" it fails:

Errror
Merlin:testapp mike$ npm install ejs@0.8.4 --no-registry
npm WARN package.json testapp@0.0.0 No description
npm WARN package.json testapp@0.0.0 No repository field.
npm WARN package.json testapp@0.0.0 No README data
npm ERR! Error: No registry url provided: GET ejs/0.8.4
npm ERR!     at RegClient.regRequest [as request] (/code/oss/npm/node_modules/npm-registry-client/lib/request.js:18:28)
npm ERR!     at RegClient.get_ (/code/oss/npm/node_modules/npm-registry-client/lib/get.js:116:8)
npm ERR!     at RegClient.<anonymous> (/code/oss/npm/node_modules/npm-registry-client/lib/get.js:43:15)
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/isaacs/npm/issues>

npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "ejs@0.8.4" "--no-registry"
npm ERR! cwd /Users/mike/sandbox/npm-programmatic-test/testapp
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.17
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/mike/sandbox/npm-programmatic-test/testapp/npm-debug.log
npm ERR! not ok code 0
My cache
Merlin:testapp mike$ npm config get cache
/Users/mike/.npm
Merlin:testapp mike$ cat /Users/mike/.npm/ejs/0.8.4/package/package.json | grep version
  "version": "0.8.4",
npm version
Merlin:testapp mike$ npm -v
1.3.17

@mikermcneil
Copy link

The workaround here works for npm v1.3.17:
https://github.com/isaacs/npm/issues/2568#issuecomment-30626394

kkaempf added a commit to kkaempf/npm2rpm that referenced this issue Jul 29, 2014
@catamphetamine
Copy link

The workaround doesn't work for me

@eeichinger
Copy link

it appears that --no-registry seems broken before and after npm version 1.3.26 - that's the only version I could get it to work with

@othiym23 othiym23 added this to the cache rewrite milestone Oct 1, 2014
@othiym23
Copy link
Contributor

othiym23 commented Oct 1, 2014

True offline support is waiting on the npm cache rewrite. It's still top of mind for me, I just have a lot of projects in flight right now.

bendaaron pushed a commit to bendaaron/meta-oe-dev that referenced this issue Jul 17, 2015
* npm/npm#3691
* npm/npm#5509

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
@onlywei
Copy link

onlywei commented Sep 4, 2015

@othiym23 The link you posted to to the npm cache rewrite is now broken and does not lead anywhere. Has this initiative been dropped? Where can I get the most up-to-date info about this?

@othiym23
Copy link
Contributor

othiym23 commented Sep 5, 2015

For those playing along at home, I followed up with @onlywei in a response to a comment he left on #5740. Work is still planned on this, but it's pending us getting some work around npm@3 (which is what shelved it) done first.

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

No branches or pull requests

9 participants