简体   繁体   English

Husky 错误 'BABEL_ENV' 不被识别为内部或外部命令,

[英]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.

相关问题 错误“env”未被识别为内部或外部命令? - error 'env' is not recognized as an internal or external command? 无法将“ NODE_ENV”识别为内部或外部命令 - 'NODE_ENV' is not recognized as an internal or external command babel-node 未被识别为内部或外部命令 - Babel 7 - babel-node is not recognized as internal or external command - Babel 7 babel-node --presets 节点 '.' 不被识别为内部或外部命令, - babel-node --presets node '.' is not recognized as an internal or external command, [NODEMON]- babel-node 未被识别为内部或外部命令 - [NODEMON]- babel-node not recognized as internal or external command Laravel 5.4 'cross-env' 未被识别为内部或外部命令 - Laravel 5.4 ‘cross-env’ Is Not Recognized as an Internal or External Command 持续存在的错误:express不被识别为内部或外部命令 - Persisting error: express is not recognized as an internal or external command #Error: wscat 未被识别为内部或外部命令 - #Error : wscat is not recognized as an internal or external command “/”不被识别为内部或外部命令 - “/” is not recognized as an internal or external command '。 不被识别为内部或外部命令, - '.' is not recognized as an internal or external command,
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM