VS Code Jest在Ubuntu 20.04上启动失败(Ubuntu make-install)



环境

  • Ubuntu 20.04(官方测试版(

  • Visual Studio代码1.44.2,通过ubuntu make(umake(安装:umake ide visual-studio-code

  • 节点12通过nvm install 12 && nvm alias default 12 && nvm use default

  • VS代码扩展:jest

错误

  • 重新启动VS代码失败,原因是:
Finished running all tests. Starting watch mode.
/bin/sh: 1: npm: not found
/bin/sh: 1: npm: not found
Starting Jest in Watch mode failed too many times and has been stopped.
see troubleshooting: https://github.com/jest-community/vscode-jest/blob/master/README.md#troubleshooting

我想使用nvm,并希望避免像调整bashrc或类似的变通方法。

不起作用:

  • 添加到VS代码settings.json(通过Ctrl+Shift+P,"打开设置Json"(:
    • 条目"terminal.integrated.shell.linux": "/bin/bash"

刚刚在ssh上运行命令时遇到问题,nvm中的节点二进制文件不会添加到非登录shell的路径中,因此无法使用。老实说,我不知道如何将其添加到那里,并使其相对于安装的用户保持不变。

如果需要,删除nvm并通过默认存储库安装apt install nodejs是一种快速的解决方法。

最新更新