nvm: --reinstall-packages-from fails: "Could not install from "" as it does not contain a package.json file"

  • Operating system and version: Fedora KDE 27

  • nvm debug output:

nvm --version: v0.33.8
$SHELL: /bin/bash
$HOME: /home/[my name]
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 4.4.19(1)-release (x86_64-redhat-linux-gnu)'
uname -a: 'Linux 4.14.18-300.fc27.x86_64 #1 SMP Thu Feb 8 01:35:31 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux'
OS version: 
curl: /usr/bin/curl, curl 7.55.1 (x86_64-redhat-linux-gnu) libcurl/7.55.1 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.18.0 (+libidn2/2.0.3) libssh2/1.8.0 nghttp2/1.25.0
wget: /usr/bin/wget, GNU Wget 1.19.4 built on linux-gnu.
git: /usr/bin/git, git version 2.14.3
grep: alias grep='grep --color=auto'
        /usr/bin/grep (grep --color=auto), grep (GNU grep) 3.1
awk: /usr/bin/awk, GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.5, GNU MP 6.1.2)
sed: /usr/bin/sed, sed (GNU sed) 4.4
cut: /usr/bin/cut, cut (GNU coreutils) 8.27
basename: /usr/bin/basename, basename (GNU coreutils) 8.27
rm: /usr/bin/rm, rm (GNU coreutils) 8.27
mkdir: /usr/bin/mkdir, mkdir (GNU coreutils) 8.27
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.6.0
nvm current: v9.6.1
which node: $NVM_DIR/versions/node/v9.6.1/bin/node
which iojs: which: no iojs in (/opt/OpenPrinting-Gutenprint/sbin:/opt/OpenPrinting-Gutenprint/bin:$NVM_DIR/versions/node/v9.6.1/bin:/usr/lib64/qt-3.3/bin:/opt/OpenPrinting-Gutenprint/sbin:/opt/OpenPrinting-Gutenprint/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:$HOME/.local/bin:$HOME/bin)
which npm: $NVM_DIR/versions/node/v9.6.1/bin/npm
npm config get prefix: $NVM_DIR/versions/node/v9.6.1
npm root -g: $NVM_DIR/versions/node/v9.6.1/lib/node_modules
  • nvm ls output:
         v9.6.0
->       v9.6.1
default -> v9.6.0
node -> stable (-> v9.6.1) (default)
stable -> 9.6 (-> v9.6.1) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> N/A)
lts/argon -> v4.8.7 (-> N/A)
lts/boron -> v6.13.0 (-> N/A)
lts/carbon -> v8.9.4 (-> N/A)
  • How did you install nvm? (e.g. install script in readme, homebrew): Install script I believe. It’s been a while.

  • What steps did you perform?

  1. nvm ls-remote
  2. See there is a new version, e.g. v9.6.1
  3. nvm install v9.6.1 --reinstall-packages-from=v9.6.0
  • What happened?
Downloading and installing node v9.6.1...
Downloading https://nodejs.org/dist/v9.6.1/node-v9.6.1-linux-x64.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v9.6.1 (npm v5.6.0)
Reinstalling global packages from v9.6.0...
npm ERR! code ENOLOCAL
npm ERR! Could not install from "" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/[my name]/.npm/_logs/2018-02-23T15_26_22_862Z-debug.log
Linking global packages from v9.6.0...
  • What did you expect to happen? Just install any previous packages like normal. This used to work fine on Ubuntu but I am on Fedora now, not sure if that makes a difference.

  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH? No.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Yes, but that will also update npm; it’s best to update your global packages (of which there should be few) manually.

because if you didn’t install anything, you don’t need to use --reinstall-packages-from, though I agree that nvm should notice that nothing is installed and prevent to call npm in this case, to avoid this problem.