相关疑难解决方法(0)

如何在Windows上设置NODE_ENV = production?

在Ubuntu中它非常简单; 我可以运行应用程序:

$ NODE_ENV=production node myapp/app.js
Run Code Online (Sandbox Code Playgroud)

但是这不适用于Windows.是否有配置文件,我可以设置属性?

node.js express

308
推荐指数
13
解决办法
31万
查看次数

HOST 不被识别为内部或外部命令

使用 ReactJS 和 NodeJS 项目克隆 Git 存储库并安装NodeJS 后

安装了 NodeJS

想在浏览器中查看结果,因此必须在具有 package.json 的根文件夹中运行

安装

之后

启动

第一个命令工作正常,但第二个命令出现以下错误

> HOST=0.0.0.0 PORT=8000 ./node_modules/.bin/react-scripts start
'HOST' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ...: `HOST=0.0.0.0 PORT=8000 ./node_modules/.bin/react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ... start script.
npm ERR! This is probably not a problem with npm. There is likely …
Run Code Online (Sandbox Code Playgroud)

node.js reactjs

4
推荐指数
1
解决办法
5525
查看次数

标签 统计

node.js ×2

express ×1

reactjs ×1