Closed gravataLonga closed 4 years ago
Hi @gravataLonga. Sorry for being late. I was too busy that i wasn't checking. Can you send me the package.json. I will investigate the problem. I don't think it's related to issue 2. As it revolve only around spawning npm process. Which is needed when restarting the watch. The issue 2 is fixed. A PR was provided by the one that issued it. And it was merged. We are using "cross-spawn" package. [still i will check]
If you can provide a repo that replicate the problem. It will be nice.
Otherwise i will investigate the possible cause. Test some hypotheses and come back.
Thank you.
Hello, Sorry to reopen this. I'm facing the same error that @gravataLonga
I get this error when running npm run watch
or npm run hot
:
events.js:292
throw er; // Unhandled 'error' event
^
Error: read ENOTCONN
at tryReadStart (net.js:574:20)
at WriteStream.Socket._read (net.js:585:5)
at WriteStream.Readable.read (internal/streams/readable.js:481:10)
at WriteStream.Socket.read (net.js:625:39)
at resume_ (internal/streams/readable.js:968:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on WriteStream instance at:
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -4053,
code: 'ENOTCONN',
syscall: 'read'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@1.0.0 watch: `mix watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project@1.0.0 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! C:\Users\my.user\AppData\Roaming\npm-cache\_logs\2021-04-15T14_09_44_444Z-debug.log
But when I run npm run dev
the error doesn't throw. And the files are compiled correctly as expected.
My environment is:
{
"name": "project",
"version": "1.0.0",
"description": "",
"main": "index.js",
"directories": {
"doc": "doc"
},
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"keywords": [],
"author": "my.user",
"license": "ISC",
"devDependencies": {
"laravel-mix": "^6.0.16",
"laravel-mix-glob": "^1.1.9",
"postcss": "^8.2.10",
"resolve-url-loader": "^3.1.2",
"sass": "^1.32.8",
"sass-loader": "^10.1.1"
},
"dependencies": {}
}
Thanks for this package, it is very useful!!
The only way to resolve the problem was running as npm run watch-poll
@gravataLonga thanks for the reply!
I tried but in my case it keeps showing the same error
events.js:292
throw er; // Unhandled 'error' event
^
Error: read ENOTCONN
at tryReadStart (net.js:574:20)
at WriteStream.Socket._read (net.js:585:5)
at WriteStream.Readable.read (internal/streams/readable.js:481:10)
at WriteStream.Socket.read (net.js:625:39)
at resume_ (internal/streams/readable.js:968:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on WriteStream instance at:
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -4053,
code: 'ENOTCONN',
syscall: 'read'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@1.0.0 watch-poll: `mix watch -- --watch-options-poll=1000`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project@1.0.0 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! C:\Users\my.user\AppData\Roaming\npm-cache\_logs\2021-04-16T07_32_38_028Z-debug.log
I don't know where the error comes from. And the fact that the npm run dev
works properly just confuses me...
@MohamedLamineAllal maybe it's really a bug with the current version watch option, if the watch command is known to work in older versions, I can use them for now. For me it is important that the watch works due to my project requirements.
Sorry my bad, you need to change something in package.json too..
OK, I downgraded to v1.1.0. Now watch and watch-poll options work, BUT it does not restart at file add, rename or remove. I will test this in a linux environment inside a vagrant machine later. :D
When i run
npm run watch
i get this error:But running the npm run dev, is totally fine!!
OS: Windows
NPM: 6.5.0
NODE: v12.7.0
Version of package installed:
I think it's related to issue #2