几个星期以来,我对Node.js / React / npm遇到了很大的问题。
在npx create-react-app
之后,我想用npm start
对其进行测试,但是此错误正在终端中写入:
Starting the development server...
/est-ggjr/node_modules/chokidar/lib/fsevents-handler.js:28
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (/est-ggjr/node_modules/chokidar/lib/fsevents-handler.js:28:11)
at setFSEventsListener (/est-ggjr/node_modules/chokidar/lib/fsevents-handler.js:82:16)
at FSWatcher.FsEventsHandler._watchWithFsEvents (/est-ggjr/node_modules/chokidar/lib/fsevents-handler.js:252:16)
at FSWatcher.<anonymous> (/est-ggjr/node_modules/chokidar/lib/fsevents-handler.js:386:25)
at LOOP (fs.js:1570:14)
at process._tickCallback (internal/process/next_tick.js:61:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! est-ggjr@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the est-ggjr@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! /Users/Leonardo/.npm/_logs/2019-08-15T22_29_44_658Z-debug.log
MacBook-Pro-Apple:est-ggjr Leonardo$
我已经完全重新安装了node.js,但是仍然存在此错误。
日志文件:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@6.9.0
3 info using node@v10.16.2
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle est-ggjr@0.1.0~prestart: est-ggjr@0.1.0
6 info lifecycle est-ggjr@0.1.0~start: est-ggjr@0.1.0
7 verbose lifecycle est-ggjr@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle est-ggjr@0.1.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/est-ggjr/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
9 verbose lifecycle est-ggjr@0.1.0~start: CWD: /est-ggjr
10 silly lifecycle est-ggjr@0.1.0~start: Args: [ '-c', 'react-scripts start' ]
11 silly lifecycle est-ggjr@0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle est-ggjr@0.1.0~start: Failed to exec start script
13 verbose stack Error: est-ggjr@0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid est-ggjr@0.1.0
15 verbose cwd /est-ggjr
16 verbose Darwin 18.6.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v10.16.2
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error est-ggjr@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the est-ggjr@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
如果有人可以帮助我,我感到非常高兴,我真的很绝望:(
答案 0 :(得分:-1)
直到今天,我还没有找到答案。 我安装了纱,一切都很好。