node.js - 如何修复ubuntu节点中的访问错误?
问题描述
最近我安装了 ubuntu 并克隆了我的 React 项目。每当我运行时npm run dev
,我的服务器加载正常,但客户端给出以下错误。
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn /home/bing/Public/TechIndia/client/node_modules/opn/xdg-open EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.1.0 start: `react-scripts start "client"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/bing/.npm/_logs/2019-07-06T21_22_35_051Z-debug.log
我已经尝试了类似问题的所有解决方案,但仍然无法解决。任何想法 ?
解决方案
1)删除node_modules并锁定文件
2) 编辑 package.json 所以新版本的 react-scripts
3)npm安装
4)cd你的应用程序
5)npm 开始
推荐阅读
- docker - 使用 Traefik 将无效子域重定向到特定 URL
- php - 类似项目 子类别
- mysql - 使用 OR 运算符组合 2 个查询
- r - 计算与R中另一个数据框重叠的值的总和
- cassandra - 忽略 Cassandra 生产机器上的机架是否安全?
- reactjs - 抽屉内容更改
- zos - 从大型机批处理 cobol 程序调用 webservice
- python - 没有名为“tensorflow.python._impl”的模块
- python - Python 错误:只有整数、切片 (`:`)、省略号 (`...`)、numpy.newaxis (`None`) 和整数或布尔数组是有效索引
- javascript - 在 CodeMirror 中仅突出显示完整的单词