gpt4 book ai didi

node.js - 错误 'env' 未被识别为内部或外部命令?

转载 作者:行者123 更新时间:2023-12-04 11:24:26 25 4
gpt4 key购买 nike

我是 node.js 的新手,我已经安装了 node.js 并使用 comm npm -v 检查了它的工作正常,我尝试测试它从

github https://github.com/quran/quran.com-frontend

运行项目的命令是
  npm run dev

我收到这个错误
    C:\Users\Acer\Desktop\quran.com-frontend-master\quran.com-frontend-master>npm run dev

> quran@1.0.0 dev C:\Users\Acer\Desktop\quran.com-frontend-master\quran.com-frontend-master
> env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node ./webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js

'env' is not recognized as an internal or external command,
operable program or batch file.
'env' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! quran@1.0.0 dev: `env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node ./webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the quran@1.0.0 dev script 'env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node ./webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the quran package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node ./webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 node ./bin/server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs quran
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls quran
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Acer\Desktop\quran.com-frontend-master\quran.com-frontend-master\npm-debug.log

最佳答案

在 Windows 上,默认情况下不识别“env”命令;在那里我找到了两个选项:

  • 改用另一个命令,例如:
  •     set VARIABLE_NAME=custom name
  • 安装 cygwin 并将其安装路径设置为 windows 环境变量。安装后,您可以从命令行使用:
  •     env VARIABLE_NAME=custom name
    这是包含 cygwin 安装详细信息的链接: https://www.howtogeek.com/howto/41382/how-to-use-linux-commands-in-windows-with-cygwin/

    关于node.js - 错误 'env' 未被识别为内部或外部命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41254781/

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