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
The follow error shows up when executing tsp code install:
PS C:\Users\xxx> tsp code install
TypeSpec compiler v0.56.0
tsp code install
Install VS Code Extension
Options:
--help Show help [boolean]
--debug Output debug log messages. [boolean] [default: false]
--pretty Enable color and formatting in TypeSpec's output to make compiler
errors easier to read. [boolean] [default: true]
--version Show version number [boolean]
--insiders Use VS Code Insiders [boolean] [default: false]
Error: spawnSync npm.cmd EINVAL
at Object.spawnSync (node:internal/child_process:1124:20)
at spawnSync (node:child_process:876:24)
at run (file:///C:/Users/xxx/AppData/Roaming/npm/node_modules/@typespec/compiler/dist/src/core/cli/utils.js:59:18)
at installVsix (file:///C:/Users/xxx/AppData/Roaming/npm/node_modules/@typespec/compiler/dist/src/core/cli/install-vsix.js:24:5)
at async installVSCodeExtension (file:///C:/Users/xxx/AppData/Roaming/npm/node_modules/@typespec/compiler/dist/src/core/cli/actions/vscode.js:6:12)
at async Object.handler (file:///C:/Users/xxx/AppData/Roaming/npm/node_modules/@typespec/compiler/dist/src/core/cli/utils.js:25:29) {
errno: -4071,
code: 'EINVAL',
syscall: 'spawnSync npm.cmd',
path: 'npm.cmd',
spawnargs: [ 'install', '--silent', '--prefix', '.', 'typespec-vscode' ]
}
I checked #3243 which fixed a similar issue. But the corresponding issue #3242 has different error stack.
Checking the source codes, looks like we need to add "shell": true here:
I met same problem when running rush format for autorest in a devbox.
at Object.spawnSync (node:internal/child_process:1117:20)
at spawnSync (node:child_process:876:24)
at run (C:\Users\xxx\GIT\autorest\eng\scripts\helpers.js:26:50)
at runPrettier (C:\Users\xxx\GIT\autorest\eng\scripts\helpers.js:48:3)
at Object. (C:\Users\xxx\GIT\autorest\eng\scripts\format.js:2:1)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) {
Describe the bug
The follow error shows up when executing
tsp code install
:I checked #3243 which fixed a similar issue. But the corresponding issue #3242 has different error stack.
Checking the source codes, looks like we need to add
"shell": true
here:typespec/packages/compiler/src/core/cli/utils.ts
Line 92 in 5da8fe7
Reproduction
Use a brand new windows environment. Install typespec 0.56, follow the doc to install vs code plugin.
Checklist
Environment
0.56.0
The text was updated successfully, but these errors were encountered: