[当我在VMWare Horizon Client(VDI)Windows机器中使用create-react-app创建反应应用程序时,它运行并运行良好,但是在执行npm run test
时却出现以下异常
events.js:167
throw er; // Unhandled 'error' event
^
Error: UNKNOWN: unknown error, watch
at FSEvent.FSWatcher._handle.onchange (fs.js:1372:28)
Emitted 'error' event at:
at NodeWatcher.checkedEmitError (Z:\MalayWorkplace\abc\abc-UI\node_modules\sane\src\node_watcher.js:159:10)
at FSWatcher.emit (events.js:182:13)
at FSEvent.FSWatcher._handle.onchange (fs.js:1378:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `react-scripts test`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test 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\malay.matwankar\AppData\Roaming\npm-cache\_logs\2019-01-30T10_53_14_533Z-debug.log
我在常规Windows机器上执行了相同的create react app,并执行了npm run test
,它按预期成功执行。
我尝试删除并重新安装node_modules,也启用了轮询功能,但是没有用。
[npm run test
中的package.json
也使用react-scripts运行测试,但我没有对package.json
中的脚本进行任何更改
我的本地计算机和VDI上的节点和npm版本都相同
Node version : 10.4.1
npm : 6.1.0
我也具有相同版本的Windows,并且正在使用相同版本的create-react-app。该问题似乎仅在VDI环境中仍然存在。另外,我不能在我的VDI上升级或降级npm / Node版本。
证明只有在我们在共享网络驱动器中执行此代码时才会发生此错误。如果我们从本地磁盘(如C驱动器)中的磁盘运行相同的代码,则测试用例将按预期执行。