【问题标题】:how to fix access errors in node for ubuntu?如何修复ubuntu节点中的访问错误?
【发布时间】:2019-07-06 21:23:52
【问题描述】:

最近我安装了 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

我已经尝试了类似问题的所有解决方案,但仍然无法解决。 有什么想法吗?

【问题讨论】:

  • 我的 react 应用已经安装好了。就像我说的那样,我从 git repo 克隆了它(在 Windows 上运行良好)
  • 请添加ls -l /home/bing/Public/TechIndia/client/node_modules/opn/xdg-open的输出和cat /home/bing/.npm/_logs/2019-07-06T21_22_35_051Z-debug.log的相关部分,如果有的话。

标签: node.js reactjs npm


【解决方案1】:

1) 删除 node_modules 并锁定文件

2) 编辑 package.json 所以新版本的 react-scripts

3)npm 安装

4)cd 你的应用程序

5)npm 启动

【讨论】:

    猜你喜欢
    • 2020-01-11
    • 2017-10-05
    • 2019-11-05
    • 1970-01-01
    • 1970-01-01
    • 2021-06-02
    • 2018-12-17
    • 1970-01-01
    • 2019-12-18
    相关资源
    最近更新 更多