babel-watch server.js fails when running npm run dev - node.js

Im currently working thru a tutorial, and have noticing that when running npm run dev, the babel-watch server.js continues to fails. I have uninstalled/reinstalled babel-cli babel-preset-env and babel-watch without success. The output of the error is
npm run dev
> back-end#1.0.0 dev /home/pietto/back-end
> babel-watch server.js
Watcher failure { Error: watch server.js ENOSPC
at FSWatcher.start (fs.js:1382:19)
at Object.fs.watch (fs.js:1408:11)
at createFsWatchInstance (/home/pietto/back-end/node_modules/chokidar /lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/pietto/back-end/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/pietto/back-end/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleFile (/home/pietto/back-end/node_modules/chokidar/lib/nodefs-handler.js:255:21)
at FSWatcher.<anonymous> (/home/pietto/back-end/node_modules/chokidar /lib/nodefs-handler.js:473:21)
at FSReqWrap.oncomplete (fs.js:153:5)
errno: 'ENOSPC',
code: 'ENOSPC',
syscall: 'watch server.js',
filename: 'server.js' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! back-end#1.0.0 dev: `babel-watch server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the back-end#1.0.0 dev 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/pietto/.npm/_logs/2018-10-12T19_20_06_169Z-debug.log

After some review, it was determined that I had multiple babel.rc process running in the background. Once I killed those process, worked well

Related

localhost:3000 refused to connect when using npm start

I am new to react and having a problem here. Whenever I try to run my react app using npm start, I am getting these errors
events.js:352
throw er; // Unhandled 'error' event
^
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/nrj/Documents/react/counter-app/public/favicon.ico'
at FSWatcher.<computed> (internal/fs/watchers.js:218:26)
at Object.watch (fs.js:1582:34)
at createFsWatchInstance (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:38:15)
at setFsWatchListener (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:81:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:233:14)
at FSWatcher.NodeFsHandler._handleFile (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:262:21)
at FSWatcher.<anonymous> (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:495:21)
at FSReqCallback.oncomplete (fs.js:193:5)
Emitted 'error' event on FSWatcher instance at:
at FSWatcher._handleError (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/index.js:260:10)
at createFsWatchInstance (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:40:5)
at setFsWatchListener (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:81:15)
[... lines matching original stack trace ...]
at FSReqCallback.oncomplete (fs.js:193:5) {
errno: -28,
syscall: 'watch',
code: 'ENOSPC',
path: '/home/nrj/Documents/react/counter-app/public/favicon.ico',
filename: '/home/nrj/Documents/react/counter-app/public/favicon.ico'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! counter-app#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the counter-app#0.1.0 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/nrj/.npm/_logs/2021-07-29T09_59_36_829Z-debug.log
I saw some solutions like updating node.js, deleting node_modules and running npm install, but they didn't work for me.
If you are running on Linux, it looks like you are exhausting the watchers limit
try following the instructions here: https://stackoverflow.com/a/55411444/2799454

facing errors while running npm start or npm run start command

I have created a react app through the command line and it started without facing any issues.
But after editing my files in the src folder, the npm start, npm run start both went to a problem.
Here's the ERROR:
`events.js:174
throw er; // Unhandled 'error' event
^
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/ruwaid/ruwaid-blog/public/index.html'
at FSWatcher.start (internal/fs/watchers.js:165:26)
at Object.watch (fs.js:1258:11)
at createFsWatchInstance (/home/ruwaid/ruwaid-blog/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:38:15)
at setFsWatchListener (/home/ruwaid/ruwaid-blog/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:81:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/ruwaid/ruwaid-blog/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:233:14)
at FSWatcher.NodeFsHandler._handleFile (/home/ruwaid/ruwaid-blog/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:262:21)
at FSWatcher. (/home/ruwaid/ruwaid-blog/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:495:21)
at FSReqWrap.oncomplete (fs.js:154:5)
Emitted 'error' event at:
at FSWatcher._handleError (/home/ruwaid/ruwaid-blog/node_modules/webpack-dev-server/node_modules/chokidar/index.js:260:10)
at createFsWatchInstance (/home/ruwaid/ruwaid-blog/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:40:5)
at setFsWatchListener (/home/ruwaid/ruwaid-blog/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:81:15)
[... lines matching original stack trace ...]
at FSReqWrap.oncomplete (fs.js:154:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ruwaid-blog#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ruwaid-blog#0.1.0 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/ruwaid/.npm/_logs/2021-01-14T18_29_11_988Z-debug.log`

framework7 stuck at executing npm scripts and start npm throws a bunch of errors

i am new to the framework and was just going through a tutorial and encountered by an error after pressing create app in the local host
Generating package.json
✔ Creating required folders structure
✔ Installing NPM Dependencies
✔ Installing NPM Dev Dependencies
Executing NPM Scripts
this happens its stuck at executing NPM scripts waited a whole 3 hours still executing
The start npm command shows the following:-
> whatchat#1.0.0 start C:\Users\piyush\whatchat
> npm run dev
> whatchat#1.0.0 dev C:\Users\piyush\whatchat
> cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js
internal/modules/cjs/loader.js:1032
throw err;
^
Error: Cannot find module 'C:\Users\piyush\whatchat\build\webpack.config.js'
Require stack:
- C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js
- C:\Users\piyush\whatchat\node_modules\webpack-dev-server\bin\webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at WEBPACK_OPTIONS (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
at requireConfig (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
at C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at Object.<anonymous> (C:\Users\piyush\whatchat\node_modules\webpack-dev-server\bin\webpack-dev-server.js:84:40) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\piyush\\whatchat\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js',
'C:\\Users\\piyush\\whatchat\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! whatchat#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the whatchat#1.0.0 dev 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! C:\Users\piyush\AppData\Roaming\npm-cache\_logs\2020-12-15T14_13_28_671Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! whatchat#1.0.0 start: `npm run dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the whatchat#1.0.0 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! C:\Users\piyush\AppData\Roaming\npm-cache\_logs\2020-12-15T14_13_28_828Z-debug.log
i searched lot on Google and discord coding help servers but could not fix this please help me out
you probably didn't install cordova before try:
npm install -g cordova

simple react works with npm start but not with nohup npm start &

I tested with a simple app generated by
npx create-react-app myfirstreact
It works fine with
npm start
but if I try to run it in the background with
nohup npm start &
I get
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: EBADF: bad file descriptor, read Emitted 'error' event at:
at lazyFs.read (internal/fs/streams.js:165:12)
at FSReqWrap.wrapper [as oncomplete] (fs.js:467:17) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! myfirstreact#0.1.0 start:
react-scripts start npm ERR! Exit status 1 npm ERR! npm ERR! Failed
at the myfirstreact#0.1.0 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/jglickman/.npm/_logs/2020-10-06T04_43_39_480Z-debug.log
Try running it like this:
nohup node scripts/start.js
I think this post will help too.

Laravel-mix - BrowserSync throwing an error at event.js:160

Not sure if the problem is related to laravel-mix, but I am having problem with Browsersync package. Here is my mix.js:
mix.js('resources/assets/js/app.js', 'public/js')
.browserSync({proxy: 'localhost:8000'})
.sass('resources/assets/sass/app.scss', 'public/css');
When I run npm run watch-poll ( watch doesn't pick up the changes, hence the watch-poll see here ) I get the following error on the console:
[Browsersync] Watching files...
events.js:160
throw er; // Unhandled 'error' event
^
Error: watch resources/views/auth/passwords ENOSPC
at exports._errnoException (util.js:1020:11)
at FSWatcher.start (fs.js:1443:19)
at Object.fs.watch (fs.js:1470:11)
at createFsWatchInstance (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleDir (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:407:19)
at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:455:19)
at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:460:16)
at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch-poll"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch 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/tanmay/.npm/_logs/2017-08-07T07_02_31_677Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch-poll: `npm run watch -- --watch-poll`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch-poll 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/tanmay/.npm/_logs/2017-08-07T07_02_31_725Z-debug.log
I am on: Ubuntu 16.04.3 (Not a VM). Running: Nodejs v6.11.2, NPM v5.3.0
When I comment out the .browserSync() call from my mix.js:
mix.js('resources/assets/js/app.js', 'public/js')
// .browserSync({proxy: 'localhost:8000'})
.sass('resources/assets/sass/app.scss', 'public/css');
however, the error no longer persists. How do I get around the problem? Please feel free to ask any other necessary information.
Here is my package.json file
UPDATE: This error doesn't occur on a new laravel project. To get the same result as a new project, this is what I did:
I removed the node modules: rm -rf node_modules I removed the package-lock.json file: rm package-lock.json I re-run: npm install, npm run dev, npm run watch-poll
Result: still same error :(
This might be due to another task running on port 4040 already.
You can try killall -9 node
Source/more details: https://github.com/parse-community/parse-dashboard/issues/401#issuecomment-224007436
I suspect it's the same problem that is shown & with working solution from Gulp Error: watch ENOSPC
Try this: Why this issue occured? There is the limit in the number of
files that can be watched in a system. We have to increase this
number. The below command can be used to increase this number.
$ echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Resources