You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running msbuild /t:GenerateCode to generate code for a client library using AutoRest fails on windows when your username has a space in it. This appears to be related to how npx interacts with NPM when the cache directory includes a space in it. By default, the cache directory is %AppData%\npm-cache on Windows, so I suspect this will hit anyone who has a space in their username.
When trying to run the target, npx will fail, with an EPERM error like this:
To work around this issue, you can explicitly set your cache location using npm, to include a path that uses the corresponding 8.3 short file name:
> npm config set cache "C:\Users\MATTG~1.ELL\AppData\Roaming\npm-cache" --global
Alternately, we could change our invocation of the npx to set the NPM_CONFIG_CACHE environment variable to something like $(TEMP)/npm-cache (perhaps scoped to the case where you're on windows and %AppData% contains a space?). It appears that when your username contains a space, %TEMP% uses the 8.3 version of your username.
The text was updated successfully, but these errors were encountered:
ghost
added
the
needs-triage
Workflow: This is a new issue that needs to be triaged to the appropriate team.
label
May 1, 2020
Running
msbuild /t:GenerateCode
to generate code for a client library using AutoRest fails on windows when your username has a space in it. This appears to be related to hownpx
interacts with NPM when the cache directory includes a space in it. By default, the cache directory is%AppData%\npm-cache
on Windows, so I suspect this will hit anyone who has a space in their username.When trying to run the target,
npx
will fail, with anEPERM
error like this:To work around this issue, you can explicitly set your cache location using
npm
, to include a path that uses the corresponding 8.3 short file name:Alternately, we could change our invocation of the
npx
to set theNPM_CONFIG_CACHE
environment variable to something like$(TEMP)/npm-cache
(perhaps scoped to the case where you're on windows and%AppData%
contains a space?). It appears that when your username contains a space,%TEMP%
uses the 8.3 version of your username.The text was updated successfully, but these errors were encountered: