Error: listen ENOTSUP: operation not supported on socket \\.\pipe\notifierPipe
WSL2にLaravel、Laravel Mixの環境を構築してパッケージ管理システムのNPMで「開発用ビルド」(npm run dev) または「本番用ビルド」(npm run production)を行うと次のようなエラーが発生します。
events.js:292 throw er; // Unhandled 'error' event
events.js:174 throw er; // Unhandled 'error' event
※エラー全文は後述します。
1. 原因
WSL(Windows Subsystem for Linux)では発生しません。WSL2が原因と思われます。エラーはNPMでビルド完了時、Windows10に「Laravel Mix」の「Build successful」(ビルド成功)の通知を出す部分で発生しています。
具体的には「名前付きパイプ」を作成する時です。
// WSLの時はこのファイルが自動生成される .pipenotifierPipe-00abf9a9-1eba-44be-9d7e-0dde05ee393f // WSL2の時はこのファイルが生成されない \\\\.\\pipe\\notifierPipe-deac9f3b-18fa-455b-abb0-e70767801c78
※ビルドは完了しているのでJS/CSSファイルには影響ありません。
2. 解決方法
エラーメッセージは無視できますが、解決したい方はutils.jsの次のコードを修正して下さい。これをやればビルド完了の通知が表示されます。
node_modules\node-notifier\lib\utils.js
2021/1/3時点のファイルではファイルの末尾のコードです。
/*
ココをコメントにする
module.exports.createNamedPipe = (server) => {
const buf = Buffer.alloc(BUFFER_SIZE);
return new Promise((resolve) => {
server.instance = net.createServer((stream) => {
stream.on('data', (c) => {
buf.write(c.toString());
});
stream.on('end', () => {
server.instance.close();
});
});
server.instance.listen(server.namedPipe, () => {
resolve(buf);
});
});
};
*/
// 次のように書き換える
module.exports.createNamedPipe = (server) => {
const buf = Buffer.alloc(BUFFER_SIZE);
return new Promise((resolve) => {
resolve(buf);
});
};
3. エラー全文
Node.jsのバージョンを上げて試したのでメッセージは2つです。
node@10.23.0、npm@6.14.8
Error: listen ENOTSUP: operation not supported on socket \\.\pipe\notifierPipe-8b1c81ba-1f09-479f-8b36-ad7b1ec88948
at Server.setupListenHandle [as _listen2] (net.js:1263:19)
at listenInCluster (net.js:1328:12)
at Server.listen (net.js:1426:5)
at Promise (/mnt/d/laravel/mpp_vue_crud_la/node_modules/node-notifier/lib/utils.js:566:21)
at new Promise (<anonymous>)
at Object.module.exports.createNamedPipe (/mnt/d/laravel/mpp_vue_crud_la/node_modules/node-notifier/lib/utils.js:557:10)
at WindowsToaster.notifyRaw (/mnt/d/laravel/mpp_vue_crud_la/node_modules/node-notifier/notifiers/toaster.js:133:9)
at WebpackNotifierPlugin.compilationDone (/mnt/d/laravel/mpp_vue_crud_la/node_modules/webpack-notifier/index.js:129:14)
at _next1 (eval at create (/mnt/d/laravel/mpp_vue_crud_la/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:19:1)
at _err1 (eval at create (/mnt/d/laravel/mpp_vue_crud_la/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:53:1)
at runTasks.then (/mnt/d/laravel/mpp_vue_crud_la/node_modules/laravel-mix/src/webpackPlugins/CustomTasksPlugin.js:28:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
Emitted 'error' event at:
at emitErrorNT (net.js:1307:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --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! /home/xxx/.npm/_logs/2021-01-02T12_13_31_122Z-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! /home/xxx/.npm/_logs/2021-01-02T12_13_31_133Z-debug.log
node@14.15.3、npm@6.14.9
Error: listen ENOTSUP: operation not supported on socket \\.\pipe\notifierPipe-deac9f3b-18fa-455b-abb0-e70767801c78
at Server.setupListenHandle [as _listen2] (net.js:1301:21)
at listenInCluster (net.js:1366:12)
at Server.listen (net.js:1463:5)
at /mnt/d/laravel/mpp_vue_crud_la/node_modules/node-notifier/lib/utils.js:566:21
at new Promise (<anonymous>)
at Object.module.exports.createNamedPipe (/mnt/d/laravel/mpp_vue_crud_la/node_modules/node-notifier/lib/utils.js:557:10)
at WindowsToaster.notifyRaw (/mnt/d/laravel/mpp_vue_crud_la/node_modules/node-notifier/notifiers/toaster.js:133:9)
at WebpackNotifierPlugin.compilationDone (/mnt/d/laravel/mpp_vue_crud_la/node_modules/webpack-notifier/index.js:129:14)
at _next1 (eval at create (/mnt/d/laravel/mpp_vue_crud_la/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:19:1)
at eval (eval at create (/mnt/d/laravel/mpp_vue_crud_la/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:53:1)
at /mnt/d/laravel/mpp_vue_crud_la/node_modules/laravel-mix/src/webpackPlugins/CustomTasksPlugin.js:28:21
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1345:8)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ENOTSUP',
errno: -95,
syscall: 'listen',
address: '\\\\.\\pipe\\notifierPipe-deac9f3b-18fa-455b-abb0-e70767801c78',
port: -1
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --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! /home/xxx/.npm/_logs/2021-01-03T02_33_43_918Z-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! /home/xxx/.npm/_logs/2021-01-03T02_33_43_938Z-debug.log
スポンサーリンク
関連記事
| 前の記事: | WSL2のUbuntu18.04をインストールする [TensorFlow GPU] |
| 次の記事: | [WSL]Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease Temporary failure resolving 'archive.ubuntu.com' |
公開日:2021年01月03日 最終更新日:2021年01月09日
記事NO:02877
プチモンテ ※この記事を書いた人
![]() | |
![]() | 💻 ITスキル・経験 サーバー構築からWebアプリケーション開発。IoTをはじめとする電子工作、ロボット、人工知能やスマホ/OSアプリまで分野問わず経験。 画像処理/音声処理/アニメーション、3Dゲーム、会計ソフト、PDF作成/編集、逆アセンブラ、EXE/DLLファイルの書き換えなどのアプリを公開。詳しくは自己紹介へ |
| 🎵 音楽制作 BGMは楽器(音源)さえあれば、何でも制作可能。歌モノは主にロック、バラード、ポップスを制作。歌詞は抒情詩、抒情的な楽曲が多い。楽曲制作は🔰2023年12月中旬 ~ | |









