1
1

More than 1 year has passed since last update.

npm init vue@latestをしたらesbuildのinstallでエラーが出た

Posted at

記事作成日: 2022/8/29

TL;DR

npm init vue@latestしてnpm installするとエラーが出た(エラーログは下に有)。
原因はnodeのバージョンが古かった。

実行環境

macOS Monterey (version12.5.1)
node -v:v16.14.2
npm -version:8.5.0

詳細

npm init vue@latestてnpm installすると、以下のようなエラーが出た。ログを読むと、esbuildのinstall.jsで問題が生じている様。

npm ERR! code 1
npm ERR! path /Users/xxx/xxx/xxx/vuetest/vue-project/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! node:child_process:828
npm ERR!     err = new Error(msg);
npm ERR!           ^
npm ERR! 
npm ERR! Error: Command failed: /Users/xxx/xxx/xxx/vuetest/vue-project/node_modules/esbuild/bin/esbuild --version
npm ERR!     at checkExecSyncError (node:child_process:828:11)
npm ERR!     at Object.execFileSync (node:child_process:866:15)
npm ERR!     at validateBinaryVersion (/Users/xxx/xxx/xxx/vuetest/vue-project/node_modules/esbuild/install.js:89:32)
npm ERR!     at /Users/xxx/xxx/xxx/vuetest/vue-project/node_modules/esbuild/install.js:242:5 {
npm ERR!   status: null,
npm ERR!   signal: 'SIGKILL',
npm ERR!   output: [ null, Buffer(0) [Uint8Array] [], Buffer(0) [Uint8Array] [] ],
npm ERR!   pid: 3966,
npm ERR!   stdout: Buffer(0) [Uint8Array] [],
npm ERR!   stderr: Buffer(0) [Uint8Array] []
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xxx/.npm/_logs/2022-08-28T09_56_36_307Z-debug-0.log

調べるとesbuildのgithubのissueでこれを発見したので、nodeのバージョンをv17.9.1に上げるとエラーは生じなかった。

【メモ】
上記のissueはesbuild install.js failと調べて見つけた。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1