React JS开始引发错误并且未运行localhost:3000

时间:2019-06-04 13:14:01

标签: node.js npm create-react-app yarnpkg

当我尝试使用create-react-app创建新应用并尝试将其启动时出现以下错误。 但旧应用仍在运行。我尝试卸载节点并创建-反应-应用,然后重新安装节点版本10.15.3 ,然后尝试抛出同样的错误并卸载它。尝试安装节点版本 v12.3.1 ,然后还会引发错误。 我还尝试过使用 yarn yarn版本1.16.0 ,但是出现了错误。已经尝试了stackoverflow和github上所有可用的解决方案。

我将package.json中的react-scripts降级到以下版本:“ react-scripts”:“ ^ 2.1.8”并且有效

OS: WIN 8.1 

I have already tried

**create-react-app**
**react@16.8.6
react-scripts@3.0.1
react-dom@16.8.6** 

节点:v10.15.3 NPM:6.4.1

my-app@0.1.0启动C:\ UI Dev \ React-Demo \ my-app     反应脚本开始

    Starting the development server...

events.js:174
throw er; // Unhandled 'error' event
^

Error: spawn cmd ENOENT
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! my-app@0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.



npm ERR! A complete log of this run can be found in:
npm ERR! 

节点:v12.3.1 NPM:6.9.0     myreactapp@0.1.0启动C:\ UI Dev \ React-Demo \ myreactapp     反应脚本开始

Starting the development server...

events.js:177
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
←[90m    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:1
9)←[39m
←[90m    at onErrorNT (internal/child_process.js:456:16)←[39m
←[90m    at processTicksAndRejections (internal/process/task_queues.js:84:9)←[39
m
Emitted 'error' event at:
←[90m    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:1
2)←[39m
←[90m    at onErrorNT (internal/child_process.js:456:16)←[39m
←[90m    at processTicksAndRejections (internal/process/task_queues.js:84:9)←[39
m {
  errno: ←[32m'ENOENT'←[39m,
  code: ←[32m'ENOENT'←[39m,
  syscall: ←[32m'spawn cmd'←[39m,
  path: ←[32m'cmd'←[39m,
  spawnargs: [ ←[32m'/c'←[39m, ←[32m'start'←[39m, ←[32m'""'←[39m, ←[32m'/b'←[39m
, ←[32m'http://localhost:3000/'←[39m ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myreactapp@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myreactapp@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!  

纱线v1.16.0

yarn start
yarn run v1.16.0
$ react-scripts start
Starting the development server...

events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    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)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
and.

0 个答案:

没有答案