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

[Bug] 对于node v20.14.0调试出现Error: spawn EINVAL的修复方法 #496

Open
lpmasser opened this issue Jun 15, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@lpmasser
Copy link

nodejs官网描述

因为发现安全漏洞,禁止子程序使用.cmd和.bat,出现Error: spawn EINVAL错误

在/.vscode/.debug.script.mjs文件中spawn函数下增加shell:true参数即可解决

更改之后的函数
spawn(
// TODO: terminate npm run dev when Debug exits.
process.platform === 'win32' ? 'npm.cmd' : 'npm',
['run', 'dev'],
{
stdio: 'inherit',
env: Object.assign(process.env, { VSCODE_DEBUG: 'true' }),
shell: true,
},
)

@lpmasser lpmasser added the bug Something isn't working label Jun 15, 2024
@XingXiaoWu
Copy link

老哥提个pr呗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants