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

reinstall-packages: linked packages unexpectedly attempt to install from registry #626

Closed
dylang opened this issue Jan 22, 2015 · 1 comment

Comments

@dylang
Copy link

dylang commented Jan 22, 2015

To reproduce:

  1. Rename a package to a name not in the registry.
  2. npm link
  3. use nvm to switch to another version of Node or io.js.
  4. nvm reinstall-packages <previous version>.
  5. reinstall-packages/npm will fail because it's trying to npm -g install <all module names>, including the linked package that is not in the registry.

Here's example output:

Copying global packages from ...
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/Users/dgreene/.nvm/versions/io.js/v1.0.3/bin/npm" "install" "-g" "--quiet" "anthology" "bower" "browser-unpack" "bundle-check" "->" "/Users/dgreene/projects/bundle-check" "changelog" "clean-css" "dark-mode" "david" "disc" "empty-trash" "fenix-cli" "gistup" "git-pull-requests" "grunt" "grunt-cli" "grunt-init" "grunt-next" "gulp" "gzipped" "hget" "ios-sim" "json" "json-diff" "jsonlint" "keybase" "n" "nestor" "next-update" "nik" "node-pre-gyp" "normit" "phantomjs" "picture-tube" "pierogi" "pkgcount" "pkgfiles" "pm2" "puer" "recursive-readdir" "serve" "static-here" "stylestats" "tidy-package" "trash" "typescript" "update" "->" "/Users/dgreene/projects/update" "veelo" "vtop"  "yo"
npm ERR! node v1.0.3
npm ERR! npm  v2.2.0
npm ERR! code E404

npm ERR! 404 Not Found: bundle-check
npm ERR! 404
npm ERR! 404 'bundle-check' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dgreene/.nvm/npm-debug.log

Note 1: It seems to be trying to install "bundle-check" "->" "/Users/dgreene/projects/bundle-check", so it knows it's a symlink, but it's not using npm link to recreate the symlink.

Note 2: It might not be possible to always support npm linked packages because they will share the same node_modules directory, and therefore won't necessarily be compatible between versions of Node (because of things like v8 bindings in binaries.) So maybe npm linked packages should just be skipped with a warning like "these packages were not copied because they are npm linked:".

@ljharb
Copy link
Member

ljharb commented Jan 22, 2015

Duplicate of #341 - this also happens with global modules that are installed from git.

@ljharb ljharb closed this as completed Jan 22, 2015
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

2 participants