0

For a I have created some tests in a __test__ folder at the same level as the src

After running npm test the project folder I get the following error

How can I fix this so that I can run my tests?

jenkins@VBOX:dashboard$ npm test

> react-scripts test --env=jsdom
Determining test suites to run...fs.js:1236
    throw error;
    ^
Error: watch /home/jenkins/dev/git-stash/dashboard/node_modules/react-scripts/node_modules/babel-jest/node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/node_modules/babel-types/node_modules/babel-runtime/node_modules/core-js/fn/symbol ENOSPC
    at exports._errnoException (util.js:907:11)
    at FSWatcher.start (fs.js:1234:19)
    at Object.fs.watch (fs.js:1262:11)
    at NodeWatcher.watchdir (/home/jenkins/dev/git-stash/dashboard/node_modules/react-scripts/node_modules/jest/node_modules/jest-cli/node_modules/sane/src/node_watcher.js:144:20)
    at Walker.<anonymous> (/home/jenkins/dev/git-stash/dashboard/node_modules/react-scripts/node_modules/jest/node_modules/jest-cli/node_modules/sane/src/node_watcher.js:353:12)
    at emitTwo (events.js:87:13)
    at Walker.emit (events.js:172:7)
    at /home/jenkins/dev/git-stash/dashboard/node_modules/react-scripts/node_modules/jest/node_modules/jest-cli/node_modules/sane/node_modules/walker/lib/walker.js:69:16
    at go$readdir$cb (/home/jenkins/dev/git-stash/dashboard/node_modules/react-scripts/node_modules/jest/node_modules/jest-cli/node_modules/graceful-fs/graceful-fs.js:149:14)
    at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR! Test failed.  See above for more details.
0

3 Answers 3

5

Sometimes we hit the limit on the number of files we can watch simultaneously and we gains the error while having plenty of free space.

On Linux (Debian Wheezy, npm v3.10.10, node v6.10.2) it can be fixed by trying $ npm dedupe first, and, if still necessary, by

$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Credits go to hexo.io.

Sign up to request clarification or add additional context in comments.

Comments

1

So that nonsensical word in all caps at the end of the first line of every node error... that's an error code. This one was ENOSPC, which means "no space on drive".

i.e. your drive was full, You must've freed up space before running npm install again, and it was the former not the latter that fixed your problem.

3 Comments

Ha! Yes that makes sense. Accepting answer.
I was on a VM that I use as a docker host. It had a load of cached images that needed clearing down.
I ran into same ENOSPC error, but I had plenty of free disk and memory. Since I was using atom with nuclide (Linux), and that's known to be a resource hog, I quite atom, relaunched it, and the error went away.
0

I got exactly same problem. and I solve this issue by installing newest npm. I got ENOSPC error with npm version 2.15.11. and it works well with v3.10.10.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.