Volta: Can't install packages with npm@7 and Volta 0.9

Created on 22 Oct 2020  路  9Comments  路  Source: volta-cli/volta

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

All 9 comments

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.

Switched back to npm@6 for now, and I'm back in business 馃槃
Thanks for your help @rwjblue 馃檹

Closing since this is an upstream issue with npm@7. 馃槍

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikrostew picture mikrostew  路  3Comments

elwayman02 picture elwayman02  路  4Comments

dherman picture dherman  路  5Comments

felipecrs picture felipecrs  路  5Comments

PrsPrsBK picture PrsPrsBK  路  4Comments