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-from fails: "Could not install from "" as it does not contain a package.json file" #1744
Comments
@steelstring94 can you print the content of |
I tested with the latest Fedora 27 Docker image but can't reproduce this problem. |
@PeterDaveHello Can you do me a favor and censor my name out of your post? I tried to censor it in my OP but I missed one. 0 info it worked if it ends with ok
1 verbose cli [ '/home/[my name]/.nvm/versions/node/v9.6.1/bin/node',
1 verbose cli '/home/[my name]/.nvm/versions/node/v9.6.1/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli '--quiet' ]
2 info using npm@5.6.0
3 info using node@v9.6.1
4 verbose npm-session 7882bbe438c61849
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for file: Could not install from "" as it does not contain a package.json file.
8 verbose stack Error: ENOENT: no such file or directory, open '/home/[my name]/package.json'
9 verbose cwd /home/[my name]
10 verbose Linux 4.14.18-300.fc27.x86_64
11 verbose argv "/home/[my name]/.nvm/versions/node/v9.6.1/bin/node" "/home/[my name]/.nvm/versions/node/v9.6.1/bin/npm" "install" "-g" "--quiet"
12 verbose node v9.6.1
13 verbose npm v5.6.0
14 error code ENOLOCAL
15 error Could not install from "" as it does not contain a package.json file.
16 verbose exit [ 1, true ] |
@steelstring94 what about the output of |
Just to confirm, is this output the raw or the modified? I wonder about the |
And yes, that output is raw. It really does have two empty double quotes. |
Looks like nvm didn't fetch the installed packages properly, what about |
/home/[my name]/.nvm/versions/node/v9.6.1/lib
└── npm@5.7.1 |
That seems correct to me; that means there's no non-npm global modules installed. It seems like the logic here doesn't actually check for "no installs" - the fix is likely as simple as wrapping https://github.com/creationix/nvm/blob/master/nvm.sh#L3341-L3342 in |
Looks like you're using a manually installed very new npm version? |
I assume @steelstring94 has something to be installed so you'd like to use that parameter to install the old packages? |
@PeterDaveHello "Looks like you're using a manually installed very new npm version?" - not as far as I'm aware. I'm pretty sure this is just what came with NVM. |
@steelstring94 it's not; 5.6.0 is the "latest" npm. you may have run |
@ljharb I have used |
So besides |
@PeterDaveHello I don't believe so. It's difficult for me to say 100% as I didn't expect this to happen so I wasn't particularly keeping track of whether I installed anything, but I switched to a new distro not long ago and I don't think I've used any NPM global packages on here yet. |
because if you didn't install anything, you don't need to use |
@steelstring94 fwiw, don’t use npm update -g; use |
@ljharb I thought |
Yes, but that will also update npm; it’s best to update your global packages (of which there should be few) manually. |
I was facing the same issue in windows 10, when my user folder has space in folder name |
@imibrar that seems like it's worth a separate bug. Can you file one? |
Operating system and version: Fedora KDE 27
nvm debug
output:nvm ls
output: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?
nvm ls-remote
nvm install v9.6.1 --reinstall-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 thePATH
?No.
The text was updated successfully, but these errors were encountered: