Skip to content

Linux Setup: Fix ENOSPC with yarn test #14

@codenameyau

Description

@codenameyau

Node.js: what is ENOSPC error and how to solve?

https://stackoverflow.com/questions/22475849/node-js-what-is-enospc-error-and-how-to-solve/32600959#32600959

Traceback

$ yarn test
yarn run v1.9.2
$ react-scripts test --env=jsdom
Error: watch /home/yau/Workspace/web-components ENOSPC
    at _errnoException (util.js:992:11)
    at FSWatcher.start (fs.js:1382:19)
    at Object.fs.watch (fs.js:1408:11)
    at NodeWatcher.watchdir (/home/yau/Workspace/web-components/node_modules/sane/src/node_watcher.js:175:20)
    at new NodeWatcher (/home/yau/Workspace/web-components/node_modules/sane/src/node_watcher.js:45:8)
    at createWatcher (/home/yau/Workspace/web-components/node_modules/jest-haste-map/build/index.js:780:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/home/yau/Workspace/web-components/node_modules/jest-haste-map/build/index.js:936:44)
    at _buildPromise._buildFileMap.then.then.hasteMap (/home/yau/Workspace/web-components/node_modules/jest-haste-map/build/index.js:355:23)
    at <anonymous>
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Solution

Run this command when you have an issue running yarn test

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    linuxsetupIssues related to setup

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions