[英]How to fix problem with start Nx react+express
[webpack-dev-server] [HPM] Error occurred while proxying request localhost:4200/api to http://localhost:3333/ [ECONNREFUSED] ( https://nodejs.org/api/errors.html#errors_common_system_errors ) [webpack-dev-server] [HPM] 代理请求 localhost:4200/api 到 http://localhost:3333/ [ECONNREFUSED] 时出错( https://nodejs.org/api/errors.html#errors_common_system )
I create nx app with react and express and when I tried to start app I had this problem我用 react 和 express 创建 nx 应用程序,当我尝试启动应用程序时遇到了这个问题
npm run start is only running the react app, so in order to use both (react+express), if nx is not installed globally, add the line npm run start 只是运行 react 应用程序,所以为了同时使用(react+express),如果全局未安装 nx,添加行
"scripts": {
"start": "nx serve",
"start-api": "nx serve api",
"build": "nx build",
"test": "nx test"
},
just bellow "start": "nx serve", and run two consoles, in one you can run只需在“开始”:“nx serve”之后运行两个控制台,您可以在一个控制台中运行
npm run start
and in the other而在另一个
npm run start-api
that way you will have both modules running and the error will disappear这样,您将同时运行两个模块并且错误将消失
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.