Create React App 单元测试不在 VMWare Horizo​​n Client 中执行

Create React App unit tests does not execute in VMWare Horizon Client

当我在 VMWare Horizo​​n Client(VDI) Windows 机器中使用 create-react-app 创建一个反应应用程序时,它 运行s 并且工作正常但是在执行 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:\Workplace\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! abc-ui@0.1.0 test: `react-scripts test`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the abc-ui@0.1.0 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\usr\AppData\Roaming\npm-cache\_logs19-01-30T10_53_14_533Z-debug.log

我在我的常规 windows 机器上做了同样的创建反应应用程序并执行 npm run test 并且它按预期成功执行。

我试过删除并重新安装 node_modules,也启用了轮询,但没有用。

另外 npm run test in package.json 使用 react-scripts 来 运行 test 我没有对 package.json

中的脚本做任何更改

我的本地计算机和 VDI 上的节点和 npm 版本相同

Node version : 10.4.1
npm : 6.1.0

我也有相同版本的 Windows 并且正在使用相同版本的 create-react-app。这个问题似乎只存在于 VDI 环境中。我也无法在我的 VDI 上升级或降级 npm/Node 版本。

原来这个错误只有在我们在共享网络驱动器中执行这段代码时才会发生。如果我们 运行 来自本地磁盘(例如 C 驱动器)的相同代码,测试用例将按预期执行。