[英]Husky error 'BABEL_ENV' is not recognized as an internal or external command,
We use Husky to run a linter and to run tests before accepting a commit.我们使用 Husky 运行 linter 并在接受提交之前运行测试。 However when I try to commit on my Windows machine, I get the error "'BABEL_ENV' is not recognized as an internal or external command".
但是,当我尝试在我的 Windows 机器上提交时,我收到错误“'BABEL_ENV' 未被识别为内部或外部命令”。 What I've been able to find is that this is an issue with Windows vs unix based operating systems.
我发现这是 Windows 与基于 unix 的操作系统的问题。 What I have not been able to find is a solution to this problem that won't affect other devs or require packages installed into the codebase for everyone else.
我无法找到解决此问题的方法,它不会影响其他开发人员或需要将软件包安装到代码库中以供其他所有人使用。
I've tried setting up win-node-env ( https://www.npmjs.com/package/win-node-env ) but I can't get it to work correctly.我尝试设置 win-node-env ( https://www.npmjs.com/package/win-node-env ),但我无法让它正常工作。 Per its instructions I set up a BABEL_ENV.cmd file, but now I'm getting a different error, related to not finding the win-node-env package.
根据它的说明,我设置了一个 BABEL_ENV.cmd 文件,但现在我遇到了一个不同的错误,与找不到 win-node-env package 有关。
It looks like it's looking inside the repo for this package, but I have installed it globally on my machine.看起来它正在寻找这个 package 的 repo,但我已经在我的机器上全局安装了它。
We use Husky to run a linter and to run tests before accepting a commit.我们使用 Husky 运行 linter 并在接受提交之前运行测试。 However when I try to commit on my Windows machine, I get the error "'BABEL_ENV' is not recognized as an internal or external command".
但是,当我尝试在我的 Windows 机器上提交时,我收到错误“'BABEL_ENV' 未被识别为内部或外部命令”。 What I've been able to find is that this is an issue with Windows vs unix based operating systems.
我发现这是 Windows 与基于 unix 的操作系统的问题。 What I have not been able to find is a solution to this problem that won't affect other devs or require packages installed into the codebase for everyone else.
我无法找到解决此问题的方法,它不会影响其他开发人员或需要将软件包安装到代码库中以供其他所有人使用。
I've tried setting up win-node-env ( https://www.npmjs.com/package/win-node-env ) but I can't get it to work correctly.我尝试设置 win-node-env ( https://www.npmjs.com/package/win-node-env ),但我无法让它正常工作。 Per its instructions I set up a BABEL_ENV.cmd file, but now I'm getting a different error, related to not finding the win-node-env package.
根据它的说明,我设置了一个 BABEL_ENV.cmd 文件,但现在我遇到了一个不同的错误,与找不到 win-node-env package 有关。
It looks like it's looking inside the repo for this package, but I have installed it globally on my machine.看起来它正在寻找这个 package 的 repo,但我已经在我的机器上全局安装了它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.