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

npm global installation fails on Windows #964

Open
s-KaiNet opened this issue Mar 24, 2021 · 9 comments
Open

npm global installation fails on Windows #964

s-KaiNet opened this issue Mar 24, 2021 · 9 comments

Comments

@s-KaiNet
Copy link

s-KaiNet commented Mar 24, 2021

I use node@12 and built-in npm. I'm trying to install the Yeoman generator:

npm install @microsoft/generator-sharepoint -g

At the last step I see an error Volta error: Could not create environment, logs:

"npm" "install" "@microsoft/generator-sharepoint" "-g"
Volta v1.0.2
Could not create environment for @microsoft/generator-sharepoint v1.12.0
at C:\Users\admin\AppData\Local\Volta\tools\image\packages@microsoft/generator-sharepoint
Please ensure you have correct permissions to the Volta directory.
Error cause: Access is denied. (os error 5)

And also below events from proc monitor:

image

When I run npm install generator-code -g to install another generator, it works well.
I don't have antivirus and even Windows Defender is switched off since that's a developer VM.
It looks like the issue only appears with huge generators with lots of files (like @microsoft/generator-sharepoint)

@charlespierce
Copy link
Contributor

Hi @s-KaiNet, that's a strange one. The fact that the error is actually "Access is denied" makes me curious if there's some other process that's somehow affecting the ability to move the files. What's also strange is we have retry behavior baked in for that operation, so if it fails it should retry for up to 30 seconds.

@cobrabr
Copy link

cobrabr commented Jul 16, 2021

I'm having the same issue trying to upgrade npx:

Volta error: Could not create environment for npx v10.2.2
at C:\Users\Cobra\AppData\Local\Volta\tools\image\packages\npx

Please ensure you have correct permissions to the Volta directory.
Error details written to C:\Users\Cobra\AppData\Local\Volta\log\volta-error-2021-07-16_19_40_41.806.log

@imadhy
Copy link

imadhy commented Nov 16, 2021

I'm having the same issue trying to upgrade npx:

Volta error: Could not create environment for npx v10.2.2
at C:\Users\Cobra\AppData\Local\Volta\tools\image\packages\npx

Please ensure you have correct permissions to the Volta directory.
Error details written to C:\Users\Cobra\AppData\Local\Volta\log\volta-error-2021-07-16_19_40_41.806.log

I'm getting same error with npx, did you manage to fix the problem ?

@cobrabr
Copy link

cobrabr commented Dec 3, 2021

@imadhy The only way I made it install properly was by running Volta from an administrator console, and even then, only for a few tools. npx simply doesn't work.

@jonybekov
Copy link

jonybekov commented Feb 14, 2022

I'm still getting this error in 2022
Both npm i -g and volta install fails.
image

@ljharb
Copy link

ljharb commented Feb 14, 2022

in npm 7+, npx is built in, and the separate npx package shouldn’t be used.

@ak274
Copy link

ak274 commented May 5, 2022

Looks like Volta doesn't work on non admin profiles in Windows.

@horihiro
Copy link

Same issue on my env, but it was fixed by enabling Developer mode.
https://docs.volta.sh/guide/getting-started#windows-installation
image

@rcsilva83
Copy link

I made a test and it looks like the use of symlinks are unnecessary. I ran npm install -g rimraf and replaced the %localappdata%\Volta\bin\rimraf.exe symlink by a renamed copy of volta-shim.exe and it worked!

Am I missing something or Volta could run totally without the need of symlinks on Windows? If yes, it would be a huge security enhancement, as Developer Mode enable much more the symlinks and Microsoft discourages the use of symlinks. For example, in my company is very difficult for someone have admin rights or have Developer Mode enabled for security reasons.

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

9 participants