Command failed error when running `yo` after update to 3.1.0 on Windows
My environment
- OS version/details:
Windows 10 (1903) 64-bit - Node version:
v12.13.0 - npm version:
6.12.0 - Version of yo :
3.1.0(also affects3.0.0, works fine on2.0.6)
After updating my global install of Yeoman on Windows 10 (1903), I can no longer run the yo command successfully from any terminal I try: cmd, Windows PowerShell, or PowerShell Core.
Every time I try, I get an error about a failure from wmic os get Caption (message quoted below). This command, run on its own in a terminal, does indeed produce the Description = Unspecified error as this error message describes.
So far, the only command I can get to run successfully is yo --version, which returns 3.1.0.
Error message
> yo
C:\Users\patridge\AppData\Roaming\npm\node_modules\yo\node_modules\windows-release\node_modules\execa\index.js:347
throw err;
^
Error: Command failed: wmic os get Caption
ERROR:
Description = Unspecified error
at makeError (C:\Users\patridge\AppData\Roaming\npm\node_modules\yo\node_modules\windows-release\node_modules\execa\index.js:174:9)
at Function.module.exports.sync (C:\Users\patridge\AppData\Roaming\npm\node_modules\yo\node_modules\windows-release\node_modules\execa\index.js:338:15)
at windowsRelease (C:\Users\patridge\AppData\Roaming\npm\node_modules\yo\node_modules\windows-release\index.js:34:24)
at osName (C:\Users\patridge\AppData\Roaming\npm\node_modules\yo\node_modules\os-name\index.js:39:18)
at new Insight (C:\Users\patridge\AppData\Roaming\npm\node_modules\yo\node_modules\insight\lib\index.js:37:13)
at Object.<anonymous> (C:\Users\patridge\AppData\Roaming\npm\node_modules\yo\lib\cli.js:54:17)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14) {
code: 2147500037,
stdout: '',
stderr: 'ERROR:\r\r\nDescription = Unspecified error\r\r\n',
failed: true,
signal: null,
cmd: 'wmic os get Caption',
timedOut: false
}
Attempts to fix
- I tried running the
wmic os get Captioncommand from an administrator promt to see if that was the issue, but no luck. - I tried restarting my terminal windows and even my entire machine after installing the update to Yeoman in case it was some PATH issue. No luck.
- I tried updating Node.js as well (with a cautionary restart afterwards). No luck.
- I reverted to [email protected]. No luck.
- [Successful workaround I was only able to fix this issue by rolling back to v2.0.6 (
npm install -g [email protected])
Potentially related items
- I found another Yeoman issue where this was mentioned, but there wasn't any resolution yet.
- This issue on another project had a similar issue with
wmicbut they closed the issue as related to antivirus.
System info
Here's the information from the issue submission command.
>yo --version && echo %PATH% %NODE_PATH% && node -e "console.log(process.platform, process.versions)"
3.1.0
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PowerShell\6\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\patridge\AppData\Local\Microsoft\WindowsApps;C:\Users\patridge\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\patridge\.dotnet\tools;C:\Users\patridge\AppData\Local\Microsoft\WindowsApps;C:\Users\patridge\AppData\Local\GitHubDesktop\bin;C:\Users\patridge\AppData\Roaming\npm %NODE_PATH% win32 {
node: '12.13.0',
v8: '7.7.299.13-node.12',
uv: '1.32.0',
zlib: '1.2.11',
brotli: '1.0.7',
ares: '1.15.0',
modules: '72',
nghttp2: '1.39.2',
napi: '5',
llhttp: '1.1.4',
http_parser: '2.8.0',
openssl: '1.1.1d',
cldr: '35.1',
icu: '64.2',
tz: '2019a',
unicode: '12.1' }
This is a windows-release package bug (https://github.com/sindresorhus/windows-release/issues/14).
Maybe you could try: https://github.com/apache/cordova-cli/issues/434#issuecomment-491292390