Laravel-mix: Need to disable notifications for v1.4.2 and macOS v10.12.6

Created on 28 Jul 2017  路  18Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 1.4.2
  • Node Version: 8.2.1
  • NPM Version: 5.3.0
  • OS: macOS 10.12.6

Description:

Running npm run dev or npm run hot fails at 95% emitting with the following error

internal/child_process.js:325
    throw errnoException(err, 'spawn');
    ^

Error: spawn EACCES
    at exports._errnoException (util.js:1024:11)
    at ChildProcess.spawn (internal/child_process.js:325:11)
    at exports.spawn (child_process.js:493:9)
    at Object.exports.execFile (child_process.js:208:15)
    at Object.module.exports.fileCommand (/Users/sahib/code/sites/payments/node_modules/node-notifier/lib/utils.js:53:13)
    at NotificationCenter.notify (/Users/sahib/code/sites/payments/node_modules/node-notifier/notifiers/notificationcenter.js:66:11)
... bla bla bla ...

If I use disableNotifications() on my webpack.mix.js file everything works fine.

I'm not sure if its related to the latest update of macOS that I just installed today in the morning.

Steps To Reproduce:

A fresh install laravel new xyz --dev and run yarn, then npm run dev.

Most helpful comment

@straube Delete your node_modules folder and try again.

All 18 comments

Hmm, I can't reproduce this.

I have the same error

humm... 馃

I did it one more time to double check, and I realized that laravel new xyz --dev creates a node_modules directory with a few modules installed, then if you run npm run dev it fails with a Permission denied error when running cross-env, if you delete the node_modules directory and run yarn again everything works fine. 馃槙

I've got the exact same issue here and removing the node_modules folder doesn't work for us. Adding the .disableNotifications() in the webpack file did work.

I just ran into this as well with npm and disabling notifications fixed it.

DONE  Compiled successfully in 3562ms                                                                                                                8:44:08 AM

internal/child_process.js:319
    throw errnoException(err, 'spawn');
    ^

Error: spawn EACCES
    at exports._errnoException (util.js:1018:11)
    at ChildProcess.spawn (internal/child_process.js:319:11)
    at exports.spawn (child_process.js:378:9)
    at Object.exports.execFile (child_process.js:143:15)
    at Object.module.exports.fileCommand (/Users/jonathan/Sites/my-app/node_modules/node-notifier/lib/utils.js:53:13)
    at NotificationCenter.notify (/Users/jonathan/Sites/my-app/node_modules/node-notifier/notifiers/notificationcenter.js:66:11)
    at WebpackNotifierPlugin.compilationDone (/Users/jonathan/Sites/my-app/node_modules/webpack-notifier/index.js:62:18)
    at Compiler.applyPlugins (/Users/jonathan/Sites/my-app/node_modules/tapable/lib/Tapable.js:61:14)
    at Watching._done (/Users/jonathan/Sites/my-app/node_modules/webpack/lib/Compiler.js:104:17)
    at compiler.emitRecords.err (/Users/jonathan/Sites/my-app/node_modules/webpack/lib/Compiler.js:78:19)
    at Compiler.emitRecords (/Users/jonathan/Sites/my-app/node_modules/webpack/lib/Compiler.js:375:38)
    at compiler.emitAssets.err (/Users/jonathan/Sites/my-app/node_modules/webpack/lib/Compiler.js:61:20)
    at applyPluginsAsyncSeries1.err (/Users/jonathan/Sites/my-app/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Users/jonathan/Sites/my-app/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/jonathan/Sites/my-app/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/jonathan/Sites/my-app/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/jonathan/Sites/my-app/node_modules/webpack/lib/Compiler.js:365:9)
    at require.forEach.err (/Users/jonathan/Sites/my-app/node_modules/webpack/lib/Compiler.js:354:15)
    at /Users/jonathan/Sites/my-app/node_modules/async/dist/async.js:421:16
    at iteratorCallback (/Users/jonathan/Sites/my-app/node_modules/async/dist/async.js:998:13)
    at /Users/jonathan/Sites/my-app/node_modules/async/dist/async.js:906:16
    at /Users/jonathan/Sites/my-app/node_modules/graceful-fs/graceful-fs.js:43:10
    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`
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!     /Users/jonathan/.npm/_logs/2017-09-05T12_44_08_827Z-debug.log

2017-09-05T12_44_08_827Z-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'watch' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle @~prewatch: @
6 info lifecycle @~watch: @
7 verbose lifecycle @~watch: unsafe-perm in lifecycle true
8 verbose lifecycle @~watch: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/jonathan/Sites/my-app/node_modules/.bin:/Applications/Postgres.app/Contents/Versions/latest/bin:./node_modules/.bin:./vendor/bin:/Users/jonathan/.composer/vendor/bin:/Users/jonathan/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle @~watch: CWD: /Users/jonathan/Sites/my-app
10 silly lifecycle @~watch: Args: [ '-c',
10 silly lifecycle   'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
11 silly lifecycle @~watch: Returned: code: 1  signal: null
12 info lifecycle @~watch: Failed to exec watch script
13 verbose stack Error: @ 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`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at EventEmitter.emit (events.js:191:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at ChildProcess.emit (events.js:191:7)
13 verbose stack     at maybeClose (internal/child_process.js:891:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
14 verbose pkgid @
15 verbose cwd /Users/jonathan/Sites/my-app
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "watch"
18 verbose node v6.11.1
19 verbose npm  v5.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ 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`
22 error Exit status 1
23 error Failed at the @ watch script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Can confirm I am experiencing the same issue, and it is resolved when notifications are disabled in webpack.mix.js

This is occurring with a fresh Laravel 5.5 project.
Node version 8.4.0
NPM version 5.4.0

95% emitting                                                                 
 DONE  Compiled successfully in 4613ms 

internal/child_process.js:325
    throw errnoException(err, 'spawn');
    ^

Error: spawn EACCES
    at _errnoException (util.js:1041:11)
    at ChildProcess.spawn (internal/child_process.js:325:11)
    at exports.spawn (child_process.js:493:9)
    at Object.exports.execFile (child_process.js:208:15)
    at Object.module.exports.fileCommand (/Users/cory/dev/ontheradar/node_modules/node-notifier/lib/utils.js:53:13)
    at NotificationCenter.notify (/Users/cory/dev/ontheradar/node_modules/node-notifier/notifiers/notificationcenter.js:66:11)
    at module.exports.WebpackNotifierPlugin.compilationDone (/Users/cory/dev/ontheradar/node_modules/webpack-notifier/index.js:62:18)
    at Compiler.applyPlugins (/Users/cory/dev/ontheradar/node_modules/tapable/lib/Tapable.js:61:14)
    at emitRecords.err (/Users/cory/dev/ontheradar/node_modules/webpack/lib/Compiler.js:268:11)
    at Compiler.emitRecords (/Users/cory/dev/ontheradar/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Users/cory/dev/ontheradar/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Users/cory/dev/ontheradar/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Users/cory/dev/ontheradar/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/cory/dev/ontheradar/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/cory/dev/ontheradar/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/cory/dev/ontheradar/node_modules/webpack/lib/Compiler.js:365:9)
    at require.forEach.err (/Users/cory/dev/ontheradar/node_modules/webpack/lib/Compiler.js:354:15)
    at /Users/cory/dev/ontheradar/node_modules/async/dist/async.js:421:16
    at iteratorCallback (/Users/cory/dev/ontheradar/node_modules/async/dist/async.js:998:13)
    at /Users/cory/dev/ontheradar/node_modules/async/dist/async.js:906:16
    at /Users/cory/dev/ontheradar/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development 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!     /Users/cory/.npm/_logs/2017-09-06T11_41_05_956Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ 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!     /Users/cory/.npm/_logs/2017-09-06T11_41_05_983Z-debug.log

2017-09-06T11_41_05_983Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.4.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 info lifecycle @~dev: @
7 verbose lifecycle @~dev: unsafe-perm in lifecycle true
8 verbose lifecycle @~dev: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/cory/dev/ontheradar/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/cory/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle @~dev: CWD: /Users/cory/dev/ontheradar
10 silly lifecycle @~dev: Args: [ '-c', 'npm run development' ]
11 silly lifecycle @~dev: Returned: code: 1  signal: null
12 info lifecycle @~dev: Failed to exec dev script
13 verbose stack Error: @ dev: `npm run development`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid @
15 verbose cwd /Users/cory/dev/ontheradar
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/Cellar/node/8.4.0/bin/node" "/usr/local/bin/npm" "run" "dev"
18 verbose node v8.4.0
19 verbose npm  v5.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ dev: `npm run development`
22 error Exit status 1
23 error Failed at the @ dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
  • Laravel Mix Version: 1.4.2
  • NPM Version: 5.4.0
  • Node Version: v8.4.0
  • OS: Both macOS 10.13 Developer Beta 9 & macOS 10.12.6

Projects base:

  • Laravel 5.5
  • Laravel 5.4

Unable to reproduce this problem at all, notification(s) worked as intended.

added below to webpack.min.js works for me.

mix.disableNotifications();

  • Laravel Mix Version: 1.4.2
  • NPM Version: 5.4.0
  • Node Version: v8.4.0
  • OS: macOS 10.12.6 Sierra

Projects base:

  • "php": ">=5.6.4",
  • "laravel/framework": "5.4.*",

mix.disableNotifications(); worked for me too.

Dear all affected,

npm has just updated to 5.4.1 and should fix binaries permission for the notifications.

5.4.1 Release: https://github.com/npm/npm/releases/tag/v5.4.1

Related issue fixed. https://github.com/npm/npm/issues/18399

@ruchern Unfortunately, I have npm 5.4.1 and I'm still getting the same error. Do you know if I have to update the permissions for global packages after updating npm?

Can also confirm the same issue on npm 5.4.2. Is there any more information on this?

Edit: So, I updated Node to the latest version then had to re-update npm. After that, I had to remove my node_modules directory then reinstall it because of project bindings, but I no longer have the error. I don't believe that my Node version was THE problem, but at some point in performing these steps, the problem was resolved. Thought I'd share.

@straube Delete your node_modules folder and try again.

@ruchern Deleting the node_modules folder worked for me. Thanks! :)

Thanks at @ruchern, but can anyone here say if there is anything that makes it obvious that we would need that step? When should we figure that reinstalling everything would be the solution to a problem like this?

@jbcksfrt most of the time after an upgrade, if anything fails, deleting and reinstalling the packages should be the first thing to do.

Thanks @ruchern I will keep that in mind going forward. But in my case and apparently that of the OP, it could happen on a fresh install. From now on if I get a weird node error I don't understand, I may try this first.

Running chmod -R u+x . in the node_modules folder and npm rebuild node-sass --force helped resolve this for me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kpilard picture kpilard  路  3Comments

rderimay picture rderimay  路  3Comments

pixieaka picture pixieaka  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments

mementoneli picture mementoneli  路  3Comments