我遵循"您的第一个分机";visual studio代码指南,在用npm安装yo
和generator-code
并运行yo code
后,我得到了这个错误
C:Users[My Name]AppDataRoamingnpmnode_modulesyonode_modulesexecaindex.js:347
throw err;
^
Error: Command failed: powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption
The term 'Get-CimInstance' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling
of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:17
+ (Get-CimInstance <<<< -ClassName Win32_OperatingSystem).caption
+ CategoryInfo : ObjectNotFound: (Get-CimInstance:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
at makeError (C:Users[My Name]AppDataRoamingnpmnode_modulesyonode_modulesexecaindex.js:174:9)
at Function.module.exports.sync (C:Users[My Name]AppDataRoamingnpmnode_modulesyonode_modulesexecaindex.js:338:15)
at windowsRelease (C:Users[My Name]AppDataRoamingnpmnode_modulesyonode_moduleswindows-releaseindex.js:39:19)
at osName (C:Users[My Name]AppDataRoamingnpmnode_modulesyonode_modulesos-nameindex.js:39:18)
at new Insight (C:Users[My Name]AppDataRoamingnpmnode_modulesyonode_modulesinsightlibindex.js:37:13)
at Object.<anonymous> (C:Users[My Name]AppDataRoamingnpmnode_modulesyolibcli.js:54:17)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
我真的不知道该怎么做,所以任何帮助都会通知
通过从PowerShell v1.0更新到PowerShell v5.1 解决