node.js - ReactJS:启动服务器时出错
问题描述
$ yarn start
Failed to compile.
Cannot read property 'compilation' of undefined
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with signal "SIGTERM".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "start-js" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我正在使用 Ubuntu 18.04.4 LTS。有时它通常在重新启动后工作,我已经匹配了所有节点、npm 和纱线版本,它很好。我已经尝试删除node_modules
. 有时它也会显示此错误。
{ [Error: EPIPE: broken pipe, write] errno: -32, code: 'EPIPE', syscall: 'write' }
在package.json scripts
"start-js": "react-scripts start",
"start": "HTTPS=true PORT=8100 REACT_APP_OPEN_TO_URL=https://xyz.University.com/localhost npm-run-all -p watch-css start-js",
解决方案
你需要安装这个插件指定你的 webpack 版本
npm install --save-dev uglifyjs-webpack-plugin@1
有关更多信息,您可以参考此网址https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/360
推荐阅读
- javascript - 事件源禁用重新连接
- python - 匹配不同数据框中的值并找到最接近的值
- duplicates - 删除具有取消的聚合值的重复项
- angular - 带有模式的正式电子邮件自定义验证不起作用
- reactjs - 提供给 filterParams 的 ag-grid 反应测试 valueFormatter
- java - 我应该为 Eclipse 数据绑定使用什么
- unit-testing - 如何在 spring webflux 单元测试中检索客户端请求的主体?
- slack - 如何通过 API 在 Slack 中嵌入音频?
- apache-spark - 使用 JMX-exporter 无法从 Java Spark 应用程序公开 Prometheus 计数器
- azure - Prometheus 是空的(没有目标)