node-notifier icon indicating copy to clipboard operation
node-notifier copied to clipboard

Error: spawn ENAMETOOLONG on Windows 10

Open hypery2k opened this issue 7 years ago • 14 comments

On Windows 10 the plugin fails if path is too long:

Error: spawn ENAMETOOLONG
[ERROR] at exports._errnoException (util.js:907:11)
[ERROR] at ChildProcess.spawn (internal/child_process.js:298:11)
[ERROR] at exports.spawn (child_process.js:362:9)
[ERROR] at Object.exports.execFile (child_process.js:151:15)
[ERROR] at Object.module.exports.fileCommand (D:\projects\ abc\ abc-parent\ abc-webapp\node_modules\node-notifier\lib\utils.js:53:13)
[ERROR] at WindowsToaster.notify (D:\projects\abc\abc-parent\abc-webapp\node_modules\node-notifier\notifiers\toaster.js:65:9)

I found a similiar issue: https://github.com/jsreport/jsreport/issues/202#issuecomment-206760198

Maybe that helps

hypery2k avatar Oct 25 '16 12:10 hypery2k

or maybe this one is better: https://github.com/karma-runner/grunt-karma/pull/163/files

hypery2k avatar Oct 25 '16 12:10 hypery2k

Interesting. Will look into it as soon as I have the time to deep dive into it. To me it looks like karma plugin has solved it by using fork instead of spawn, but that wouldn't do much for this as we don't have a node process, but an actual remote executable. Must be others having this issue too, one would think.

mikaelbr avatar Oct 25 '16 13:10 mikaelbr

Any news on this one, we are having the same issue :-(

tknuts avatar Dec 06 '16 12:12 tknuts

We were planning on moving from Toast to KDE's snoretoast, but i'm unsure if this bug is limited to just the binary/program, or if it's a problem with Windows 10's notifications system. Otherwise, no progress has been made on this issue as of yet.

kurisubrooks avatar Dec 06 '16 12:12 kurisubrooks

Could you possibly test out using the latest https://github.com/mikaelbr/node-notifier/pull/134?

mikaelbr avatar Dec 06 '16 12:12 mikaelbr

I am using the latest 4.6.1

tknuts avatar Dec 06 '16 12:12 tknuts

But do you have the same issue if you try using https://github.com/mikaelbr/node-notifier/pull/134 ?

mikaelbr avatar Dec 06 '16 12:12 mikaelbr

I'm new to npm, how do I update my node_module with this #134 from npm ?

tknuts avatar Dec 06 '16 12:12 tknuts

Should be npm install @master-aul/node-notifier

kurisubrooks avatar Dec 06 '16 12:12 kurisubrooks

it says not found :-(

tknuts avatar Dec 06 '16 12:12 tknuts

NB: Try without the @ before master-aul. npm install @master-aul/node-notifier will try to install node-notifier as a package on the @master-aul scope, but npm install master-aul/node-notifier will try to install from the master branch of the github repo node-notifier of the user master-aul.

So this should work:

npm install master-aul/node-notifier

mikaelbr avatar Dec 06 '16 12:12 mikaelbr

Ah, didn't know that. Thanks! I know you can also npm install https://github.com/master-atul/node-notifier.git though. Bit longer, your method's better..

kurisubrooks avatar Dec 06 '16 12:12 kurisubrooks

Initially I thought this was due to too many nested directories and the vendor files getting too long path, but I think it might not be the case. Maybe. Could you show me the output command line when getting the error?

You can see the output by installing current master:

npm i mikaelbr/node-notifier

and run your files by prefixing DEBUG=true (if on mac). See https://github.com/mikaelbr/node-notifier/blob/master/CONTRIBUTE.md

mikaelbr avatar Jan 19 '17 20:01 mikaelbr

got this today:

It's been working great for weeks, not sure why it's now failing

Error: spawn ENAMETOOLONG at _errnoException (util.js:1024:11) at ChildProcess.spawn (internal/child_process.js:323:11) at exports.spawn (child_process.js:502:9) at Object.exports.execFile (child_process.js:212:15) at Object.module.exports.fileCommand (f:\Github\eth-client\node_modules\node-notifier\lib\utils.js:53:13) at WindowsToaster.notify (f:\Github\eth-client\node_modules\node-notifier\notifiers\toaster.js:65:9) at WebpackBuildNotifierPlugin.onCompilationDone (f:\Github\eth-client\node_modules\webpack-build-notifier\index.js:172:18) at Compiler.applyPlugins (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:61:14) at Watching._done (f:\Github\eth-client\node_modules\webpack\lib\Compiler.js:104:17) at onCompiled (f:\Github\eth-client\node_modules\webpack\lib\Compiler.js:54:18) at applyPluginsAsync.err (f:\Github\eth-client\node_modules\webpack\lib\Compiler.js:514:14) at next (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:202:11) at Compiler. (f:\Github\eth-client\node_modules\webpack\lib\CachePlugin.js:78:5) at Compiler.applyPluginsAsyncSeries (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:206:13) at compilation.seal.err (f:\Github\eth-client\node_modules\webpack\lib\Compiler.js:511:11) at Compilation.applyPluginsAsyncSeries (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:195:46) at self.applyPluginsAsync.err (f:\Github\eth-client\node_modules\webpack\lib\Compilation.js:680:19) at Compilation.applyPluginsAsyncSeries (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:195:46) at self.applyPluginsAsync.err (f:\Github\eth-client\node_modules\webpack\lib\Compilation.js:671:11) at Compilation.applyPluginsAsyncSeries (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:195:46) at self.applyPluginsAsync.err (f:\Github\eth-client\node_modules\webpack\lib\Compilation.js:666:10) at next (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:202:11)

sgehrman avatar Nov 27 '17 01:11 sgehrman