Parcel: `parcel index.html` report 'Error: ENOSPC: no space left on device' on ubuntu 18.0.4 x64 with node 10

Created on 24 May 2018  ยท  11Comments  ยท  Source: parcel-bundler/parcel

๐Ÿ› bug report

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

package.json

{
  "name": "index",
  "version": "1.0.0",
  "description": "index.walfud.com",
  "main": "index.js",
  "scripts": {
    "start": "parcel index.html",
    "build": "rm -rf ./dist/ ./.cache/ && parcel build",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/walfud/index.git"
  },
  "keywords": [
    "homepage"
  ],
  "author": "walfud",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/walfud/index/issues"
  },
  "homepage": "https://github.com/walfud/index#readme",
  "dependencies": {
    "react": "^16.3.2",
    "react-dom": "^16.3.2"
  },
  "devDependencies": {
    "babel-polyfill": "^6.26.0",
    "parcel-bundler": "^1.8.1"
  }
}

.babel
```.js
{
"presets": [
[
"env",
{
"targets": {
"node": "8.11.1"
},
"exclude": [
]
}
]
],
"plugins": [],
"sourceMaps": true,
"retainLines": true
}


index.html
```html
<html>

<head>
    <title>By walfud</title>
</head>

<body>
    <div id="app"></div>
    <script src="./index.js"></script>
</body>

</html>

index.js

cosole.log(1)

๐Ÿ˜ฏ Current Behavior

walfud@walfud-VirtualBox:~/Projects/index$ npm start

[email protected] start /home/walfud/Projects/index
parcel index.html

Server running at http://localhost:1234
โณ Building es6.string.ends-with.js...
events.js:167
throw er; // Unhandled 'error' event
^

Error: ENOSPC: no space left on device, watch '/home/walfud/Projects/index/node_modules/caniuse-lite/data/regions/GI.js'
at FSWatcher.start (fs.js:1375:26)
at Object.fs.watch (fs.js:1412:11)
at createFsWatchInstance (/home/walfud/Projects/index/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/walfud/Projects/index/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/walfud/Projects/index/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:229:14)
at FSWatcher.NodeFsHandler._handleFile (/home/walfud/Projects/index/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:256:21)
at FSWatcher. (/home/walfud/Projects/index/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:474:21)
at FSReqWrap.oncomplete (fs.js:150:5)
Emitted 'error' event at:
at FSWatcher._handleError (/home/walfud/Projects/index/node_modules/parcel-bundler/node_modules/chokidar/index.js:260:10)
at createFsWatchInstance (/home/walfud/Projects/index/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:39:5)
at setFsWatchListener (/home/walfud/Projects/index/node_modules/parcel-bundler/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[... lines matching original stack trace ...]
at FSReqWrap.oncomplete (fs.js:150:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: parcel index.html
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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! /home/walfud/.npm/_logs/2018-05-24T01_40_55_832Z-debug.log

๐ŸŒ Your Environment

ubuntu 18.0.4 x64
node 10.2.0
npm 5.6.9
parcel 1.8.1

Question

Most helpful comment

I have same issue in Ubuntu 18

sudo sysctl fs.inotify.max_user_watches=999999999 works for me. 9999 is not enough...

All 11 comments

Do you have space left on the location parcel is trying to build to?

If that's not the issue, than I guess this is a chokidar issue. Could you have a try with the current master branch?

Yes, I'm sure there are enough space (both inode & block).
How do I "_try with the current master branch?_"

If you're using yarn you can do it like this:

git clone https://github.com/parcel-bundler/parcel.git
cd parcel
yarn
yarn link

than go into your project and do:

yarn link "parcel-bundler"

And make sure you use the script section of package.json as I'm not sure how to do this with a global install

Ok, I'll try

Finally I found solution here: https://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached
Ubuntu set max_user_watches = 8192 for me (virtualbox). When I change to 99999, everything works fine

I am experiencing the same issue.

It appears that every file in node_modules (recursively) is being watched for changes.

Intuitively, this should not be necessary. Only the source files should be watched.

Right?

Is there any way to disable watching all of node_modules?

I have same issue in Ubuntu 18

sudo sysctl fs.inotify.max_user_watches=999999999 works for me. 9999 is not enough...

Besides, I don't have this issue in my another PC with Ubuntu 16.

Note that above command is not permenent. Persist it by echo fs.inotify.max_user_watches=999999999 | sudo tee -a /etc/sysctl.conf and sudo sysctl --system

whoever getting this type of error please delete the node_modules folder and in the terminal type "npm install"
i hope it will help you

I have same issue in Ubuntu 18

sudo sysctl fs.inotify.max_user_watches=999999999 works for me. 9999 is not enough...

it worked for me on Ubuntu 16.04

Was this page helpful?
0 / 5 - 0 ratings