Skip to content

Instantly share code, notes, and snippets.

@lamngockhuong
Created May 21, 2019 09:57
Show Gist options
  • Save lamngockhuong/dd94d179d195a815b593135fa18f6f11 to your computer and use it in GitHub Desktop.
Save lamngockhuong/dd94d179d195a815b593135fa18f6f11 to your computer and use it in GitHub Desktop.
npm test error with jest on reactjs (ubuntu)

Error on ubuntu

> react-scripts test

Error: watch /home/lam.ngoc.khuong/develop/project/my-workspace/react/learn-react/hackernews/node_modules/accepts ENOSPC
    at FSWatcher.start (fs.js:1382:19)
    at Object.fs.watch (fs.js:1408:11)
    at NodeWatcher.watchdir (/home/lam.ngoc.khuong/develop/project/my-workspace/react/learn-react/hackernews/node_modules/sane/src/node_watcher.js:159:22)
    at Walker.<anonymous> (/home/lam.ngoc.khuong/develop/project/my-workspace/react/learn-react/hackernews/node_modules/sane/src/common.js:109:31)
    at emitTwo (events.js:126:13)
    at Walker.emit (events.js:214:7)
    at /home/lam.ngoc.khuong/develop/project/my-workspace/react/learn-react/hackernews/node_modules/walker/lib/walker.js:69:16
    at go$readdir$cb (/home/lam.ngoc.khuong/develop/project/my-workspace/react/learn-react/hackernews/node_modules/graceful-fs/graceful-fs.js:162:14)
    at FSReqWrap.oncomplete (fs.js:135:15)
npm ERR! Test failed.  See above for more details.

Fix it on linux:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment