5

I am getting an error while running my server file using nodemon. When I type the command nodemon, I get the following output.

[~/D/g/sendMail-lib|3.6.5]
‹master*› »»»» nodemon                                                0|15:35:32
[nodemon] 1.17.5
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
[nodemon] Internal watch failed: ENOSPC: no space left on device, watch '/home/abdus/Documents/github/sendMail-lib/3808.txt'
[~/D/g/sendMail-lib|3.6.5]
‹master*› »»»»

Additionally, it creates almost 4000 blank text files(1.txt, 2.txt and so on).

I tried this commands but the problem still persists.

I am on Arch Linux with Node version 10.5.0, NPM version 6.1.0 and Nodemon version 1.17.5.

Just ask me if you need any more information.

Abdus
  • 192
  • 3
  • 10

5 Answers5

4

I had the same problem. Run nodemon as sudo.

$ sudo nodemon

Or

# nodemon

Most issues I run into with Arch are solved by just running as root. ;)

  • 1
    I'd strongly advise against running things as root, though. – awwright Jul 06 '18 at 03:14
  • This is useful. However as @awwright commented it is not recommended to run this as _root_. I'd upvote this if it includes the alternative to just give the right permissions to the folders|files as appropriate. – lealceldeiro Aug 29 '18 at 15:30
4
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Taken from here.

Yuriy Rypka
  • 1,937
  • 1
  • 19
  • 23
3

This is effectively a rights problem, but you don't need to use sudo, just give the user that run nodemon the rights to write to the build directory

an exemple with permissive rights (we use nodemon, so I assume we are in dev)

sudo chmod a+rwX my-application-dir
DevTheJo
  • 2,179
  • 2
  • 21
  • 25
2

I installed nodemon locally so, I created an "npm start" script and run it as root like so: sudo npm start

Nenoj
  • 197
  • 1
  • 8
2

I got this error when trying to run npm start with a start script that looked like this:

"start": "nodemon server.js"

It seems that I had a global installation of nodemon, but not a local version in my project's node_modules. Once I ran npm install nodemon, it installed it locally and worked without requiring root permissions.

nodemon: v1.18.5

OS: ubuntu 18.04

foundling
  • 1,695
  • 1
  • 16
  • 22