Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js simple react适用于npm启动,但不适用于nohup npm启动&;_Node.js_Reactjs_Linux - Fatal编程技术网

Node.js simple react适用于npm启动,但不适用于nohup npm启动&;

Node.js simple react适用于npm启动,但不适用于nohup npm启动&;,node.js,reactjs,linux,Node.js,Reactjs,Linux,我用一个由 npx create-react-app myfirstreact 它可以很好地与 npm start 但是如果我试着在后台用 nohup npm start & 我明白了 正在启动开发服务器 events.js:174 投掷者;//未处理的“错误”事件 ^ 错误:EBADF:错误的文件描述符,在以下位置读取发出的“错误”事件: 在lazyFs.read(internal/fs/streams.js:165:12) 在FSReqWrap.wrapper[as on

我用一个由

npx create-react-app myfirstreact
它可以很好地与

npm start
但是如果我试着在后台用

   nohup npm start &
我明白了

正在启动开发服务器

events.js:174 投掷者;//未处理的“错误”事件 ^

错误:EBADF:错误的文件描述符,在以下位置读取发出的“错误”事件: 在lazyFs.read(internal/fs/streams.js:165:12) 在FSReqWrap.wrapper[as oncomplete](fs.js:467:17)npm ERR!代码ELIFECYCLE npm ERR!错误1 npm错误!myfirstreact@0.1.0开始:
react脚本启动
npm错误!退出状态1 npm错误!npm错误!失败 在myfirstreact@0.1.0开始脚本。npm错误!这可能不是 npm的一个问题。上面可能还有其他日志输出

npm错误!此运行的完整日志可在以下位置找到:npm ERR
/home/jglickman/.npm/_logs/2020-10-06T04_43_39_480Z-debug.log


试着像这样运行它:

nohup node scripts/start.js  

我想这也会有帮助。

您是否尝试过这里提供的解决方案:您好。谢谢你的回复。我刚才试过了。我所接受的解决方案不适用于我,因为这个简单的应用程序只使用导入。我需要在进口商品上加上uuu dirname吗?以下是我的一些其他尝试:jglickman@devapp01:~/git/test/myfirstreact$node src/App.js/home/jglickman/git/test/myfirstreact/src/App.js:1从“React”导入React;^^^SyntaxError:意外标识符您是否尝试过其他解决方案?就像在括号中运行一样,就像运行nohup node server.js一样。以下是结果:
joshua@joshua-KVM:~/git/test/myfirstreact$node server.js internal/modules/cjs/loader.js:638 throw err;^错误:找不到模块“/home/joshua/git/test/myfirstreact/server.js”joshua@joshua-KVM:~/git/test/myfirstreact$cd srcjoshua@joshua-KVM:~/git/test/myfirstreact/src$node server.js internal/modules/cjs/loader.js:638 throw err;^错误:找不到模块“/home/joshua/git/test/myfirstreact/src/server.js”
我相信这是因为没有像server.js这样的文件:)