'sed' 未被识别为内部或外部命令 (Windows 10)

'sed' is not recognized as an internal or external command (Windows 10)

我正在使用一个 JavaScript 应用程序,它是由 yarn 运行 开发的。我在 运行 yarn run dev 时发现了问题。显示以下错误。

yarn run v1.21.1
$ yarn fixlitepicker && rm -rf .cache/ dist/
$ sed -i 's/# sourceMappingURL/ sourceMappingURL/g' node_modules/litepicker/dist/js/main.js
'sed' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

我知道它来自 package.json 脚本。

"scripts": {
    "dev": "parcel src/index.html",
    "build": "yarn install && yarn fixlitepicker && parcel build src/index.html",
    "prebuild": "rm -rf dist",
    "predev": "yarn fixlitepicker && rm -rf .cache/ dist/",
    "fixlitepicker": "sed -i 's/# sourceMappingURL/ sourceMappingURL/g' node_modules/litepicker/dist/js/main.js"
  },

我已经下载 SED from here 并安装了。安装位置 C:\Program Files (x86)\GnuWin32。但它不起作用。我看到了同样的问题。我不明白如何解决这个问题。

系统

OS: Windows 10 Pro.
OS 版本: 1909.
OS 系统类型: 64-bit operating system, x64-based processor.

您是否按照此处所述设置了 HOME 目录,http://gnuwin32.sourceforge.net/install.html

如果没有解决,请安装 http://cygwin.com/ 并试一试

您从 GnuWin32 下载并安装了“sed”,但它不在您的路径中。 您需要在将 C:\Program Files (x86)\GnuWin32 添加到 PATH 的终端中 运行。您可能还会从安装“which”中受益,然后您可以使用 which sed

进行健全性检查