gpt4 book ai didi

npm - Visual Studio Code - 使用 NPM 脚本时找不到 NPM

转载 作者:行者123 更新时间:2023-12-04 18:26:19 38 4
gpt4 key购买 nike

如果我打开集成终端并运行 npm -v 它会起作用。

Working

但是,如果我直接从 NPM SCRIPTS 运行它,它就不起作用。

Not working

评论中要求的更多详细信息

//由 Fogmeister 编辑

我也有这个问题,这里有更多细节......

我在 package.json 中定义了一个 test 脚本...

enter image description here

当我使用 npm run test 从根文件夹命令行运行此脚本时,它有效...

enter image description here

此脚本出现在 VS Code 中的 NPM 脚本列表中...

enter image description here

当我从 NPM Scripts 资源管理器运行时,它失败了...

enter image description here

即使它说它是从同一个文件夹运行的。

最佳答案

尝试做,使用 dnf 或 apt-get

sudo apt-get/dnf install npm

npm 文件应该在/usr/local/bin/npm 中。如果不存在,请使用其网站上的软件包再次安装 node.js。

关于npm - Visual Studio Code - 使用 NPM 脚本时找不到 NPM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57723039/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com