successdav's avatar

Npm run watch displays error after compiling then stops watching

It compiles up untill 95 percent then displays

DONE Compiled successfully in 32854ms 3:57:42 AM

   Asset     Size  Chunks                    Chunk Names

/js/app.js 1.51 MB 0 [emitted] [big] /js/app /css/app.css 21.3 kB 0 [emitted] /js/app internal/child_process.js:313 throw errnoException(err, 'spawn');

followed this error. I dont understand the error, please if you do help me get a solution thanks


 DONE  Compiled successfully in 32854ms                               3:57:42 AM


       Asset     Size  Chunks                    Chunk Names
  /js/app.js  1.51 MB       0  [emitted]  [big]  /js/app
/css/app.css  21.3 kB       0  [emitted]         /js/app
internal/child_process.js:313
    throw errnoException(err, 'spawn');
    ^

Error: spawn UNKNOWN
    at exports._errnoException (util.js:1026:11)
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at exports.spawn (child_process.js:380:9)
    at Object.exports.execFile (child_process.js:143:15)
    at C:\Users\SUCCESS\Homestead\Projects\success_techmax\node_modules\node-not
ifier\lib\utils.js:104:8
    at C:\Users\SUCCESS\Homestead\Projects\success_techmax\node_modules\node-not
ifier\lib\utils.js:111:22
    at FSReqWrap.oncomplete (fs.js:123:15)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files (x86)\Nodist\v-x64\6.9.1\node.exe" "C:\Pro
gram Files (x86)\Nodist\npmv\3.10.9\bin\npm-cli.js" "run" "development" "--
" "--watch"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin
/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/we
bpack.config.js "--watch"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node
_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/
laravel-mix/setup/webpack.config.js "--watch"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js
--progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config
.js "--watch"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\SUCCESS\Homestead\Projects\success_techmax\npm-debug.log

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files (x86)\Nodist\v-x64\6.9.1\node.exe" "C:\Pro
gram Files (x86)\Nodist\npmv\3.10.9\bin\npm-cli.js" "run" "watch"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! @ watch: `npm run development -- --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch script 'npm run development -- --watch'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run development -- --watch
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\SUCCESS\Homestead\Projects\success_techmax\npm-debug.log

C:\Users\SUCCESS\Homestead\Projects\success_techmax>
0 likes
10 replies
bobbybouwmann's avatar

Most of the time this error means that you have to wrong file permissions on your assets. Make sure they all have the correct rights and belong to the correct user.

1 like
successdav's avatar

It was working fine two days back. I shut down the PC went for vacation, return back boot up the PC and npm run watch is not running. I run as administrator and tried again same error. How else do I solve this permission issue. I AM USING WINDOWS 7 64 bit OS

successdav's avatar

edited: @BOBBYBOUWMANN - Can you please look closely at the error generated and help me get back to coding. Am really stock. I had even run git reset --hard to the previous commit before the last one I commited, that am sure everything was ok but it still not working.

bobbybouwmann's avatar

It's probably the versioning part that is throwing an error here!

What for info can you find in this file: C:\Users\SUCCESS\Homestead\Projects\success_techmax\npm-debug.log?

successdav's avatar

@BOBBYBOUWMANN - here is what i have at the npm-debug.log file

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files (x86)\Nodist\v-x64\6.9.1\node.exe',
1 verbose cli   'C:\Program Files (x86)\Nodist\npmv\3.10.9\bin\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'watch' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle @~prewatch: @
6 silly lifecycle @~prewatch: no script for prewatch, continuing
7 info lifecycle @~watch: @
8 verbose lifecycle @~watch: unsafe-perm in lifecycle true
9 verbose lifecycle @~watch: PATH: C:\Program Files (x86)\Nodist\npmv.10.9\bin\node-gyp-bin;C:\Users\SUCCESS\Homestead\Projects\success_techmax\node_modules\.bin;C:\Program Files (x86)\Nodist\v-x64.9.1;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\SUCCESS\homesteadconfig\homestead;C:\Program Files\Git\cmd;C:\Python27;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files (x86)\Nodist\bin;C:\HashiCorp\Vagrant\bin;C:\Program Files\PuTTY\;C:\Users\SUCCESS\AppData\Local\Programs\Microsoft VS Code\bin
10 verbose lifecycle @~watch: CWD: C:\Users\SUCCESS\Homestead\Projects\success_techmax
11 silly lifecycle @~watch: Args: [ '/d /s /c', 'npm run development -- --watch' ]
12 silly lifecycle @~watch: Returned: code: 1  signal: null
13 info lifecycle @~watch: Failed to exec watch script
14 verbose stack Error: @ watch: `npm run development -- --watch`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files (x86)\Nodist\npmv.10.9\lib\utils\lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files (x86)\Nodist\npmv.10.9\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid @
16 verbose cwd C:\Users\SUCCESS\Homestead\Projects\success_techmax
17 error Windows_NT 6.1.7601
18 error argv "C:\Program Files (x86)\Nodist\v-x64\6.9.1\node.exe" "C:\Program Files (x86)\Nodist\npmv\3.10.9\bin\npm-cli.js" "run" "watch"
19 error node v6.9.1
20 error npm  v3.10.9
21 error code ELIFECYCLE
22 error @ watch: `npm run development -- --watch`
22 error Exit status 1
23 error Failed at the @ watch script 'npm run development -- --watch'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the  package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     npm run development -- --watch
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
bobbybouwmann's avatar

Mmh I'm not sure what it can be. I still think it's a file permission issue!

munazzil's avatar

Have you try with below command and see,

  npm run dev

then it is most probably cache error try to remove cache,

  php artisan cache:clear
  php artisan view:clear
successdav's avatar
successdav
OP
Best Answer
Level 4

I finally got it fixed by formatting my PC but if you are facing this issue you dont need to format your PC, the problem was from the node. I needed to update my node but unfortunately for me, my PC refused to uninstall the node that was already install.

justrusty's avatar

Just delete node_modules folder and the lock file and run yarn/npm install again

Please or to participate in this conversation.