Hi,
I just upgraded to the latest 0.9 and I can't install packages anymore 馃槥
volta install netlify-cli
error: Could not install package 'netlify-cli'
Please confirm the package is valid and run with `--verbose` for more diagnostics.
[verbose] Installing netlify-cli with command: "npm" "install" "--global" "--loglevel=warn" "--no-update-notifier" "--no-audit" "netlify-cli"
[verbose] [install stderr]
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path /Users/frank/.volta/tmp/.tmpO1Zq9R/lib
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, lstat '/Users/frank/.volta/tmp/.tmpO1Zq9R/lib'
npm ERR! enoent This is related to npm not being able to find a file.
I get the same error when i run npm install --global.
It was working perfectly before, is there some node/npm config to check here?
which node
/Users/frank/.volta/bin/node
Thanks
Same thing here!
Can you try with:
VOLTA_LOGLEVEL=debug RUST_BACKTRACE=full volta install <thing>
And share the output?
Sure.
volta install npm@7
success: installed and set [email protected] as default
volta install yarn
success: installed and set [email protected] as default
VOLTA_LOGLEVEL=debug RUST_BACKTRACE=full volta install netlify-cli
[verbose] Acquiring lock on Volta directory: /Users/frank/.volta/volta.lock
[verbose] Found default configuration at '/Users/frank/.volta/tools/user/platform.json'
[verbose] [email protected] has already been fetched, skipping download
[verbose] [email protected] has already been fetched, skipping download
[verbose] [email protected] has already been fetched, skipping download
[verbose] Installing netlify-cli with command: "npm" "install" "--global" "--loglevel=warn" "--no-update-notifier" "--no-audit" "netlify-cli"
[verbose] [install stderr]
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path /Users/frank/.volta/tmp/.tmpb9aSag/lib
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, lstat '/Users/frank/.volta/tmp/.tmpb9aSag/lib'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/frank/.npm/_logs/2020-10-22T14_14_19_169Z-debug.log
[verbose] [install stdout]
[verbose] Unlocking Volta Directory
error: Could not install package 'netlify-cli'
Please confirm the package is valid and run with `--verbose` for more diagnostics.
[verbose] No custom hooks found
Does this only happen with npm@7 set as your default, or is it the same even with npm@6?
Bingo, it looks like so:
volta install tailwindcss
success: installed [email protected] with executables: tailwind, tailwindcss
volta install npm@7
success: installed and set [email protected] as default
volta install tailwindcss
error: Could not install package 'tailwindcss'
I _think_ I could install npm packages with npm@7 with previous Volta version 馃
Thanks for the report @DirtyF and the debugging @rwjblue! It looks like this is a bug with custom prefix directories in npm 7, see https://github.com/npm/cli/issues/2012.
That said, we can probably work around it in Volta by making sure those directories are created ahead of time.
I'm actually going to keep this open for now, as while it's an upstream bug, we can still work around it and make our implementation more robust.
Released the fix for this in Volta 0.9.1