create-react-app 仅与 "react-scripts": "2.1.8" 一起工作

g9icjywg  于 3个月前  发布在  React
关注(0)|答案(2)|浏览(45)

节点已更新,版本为@v14.5.0。我尝试删除了node_modules和package-lock.js文件,然后运行node install。
Better Explanation
最终这个方法有效: StackOverflow
默认情况下,安装将使用最新的包,但这会导致以下错误:

C:\Users\*\Dokumente\NetBeansProjects\helloreact>npm start

> helloreact@0.1.0 start C:\Users\*\Dokumente\NetBeansProjects\helloreact
> react-scripts start

i 「wds」: Project is running at http://0.0.0.0:3000/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from C:\Users\*\Dokumente\NetBeansProjects\helloreact\public
i 「wds」: 404s will fallback to /
Starting the development server...

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

Error: spawn powershell ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn powershell',
  path: 'powershell',
  spawnargs: [
    '-NoProfile',
    '-NonInteractive',
    '–ExecutionPolicy',
    'Bypass',
    '-EncodedCommand',
    'UwB0AGEAcgB0ACAAIgBgACIAaAB0AHQAcAA6AC8ALwBsAG8AYwBhAGwAaABvAHMAdAA6ADMAMAAwADAAYAAiACIA'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! helloreact@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the helloreact@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!     C:\Users\*\AppData\Roaming\npm-cache\_logs\2020-08-31T19_07_56_878Z-debug.log

2020-08-31T19_07_56_878Z-debug.log

dgjrabp2

dgjrabp22#

这个问题已经被自动标记为过时,因为它没有任何最近的活动。如果没有发生任何进一步的活动,它将在5天后被关闭。

相关问题