LoginSignup
0
0

More than 1 year has passed since last update.

[laravel8]npm run dev実行時エラー『You are using an unsupported version of Node.』

Last updated at Posted at 2021-09-03

laravelインストール後、npm run dev実行時にエラーが発生した。
※『composer install』『npm install』は実行した前提。

C:\Users\hp\Desktop\test\blog>npm run dev
npm WARN lifecycle The node binary used for scripts is C:\Program Files (x86)\Nodist\bin\node.exe but npm is using C:\Program Files (x86)\Nodist\v-x64\11.13.0\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> @ dev C:\Users\hp\Desktop\test\blog
> npm run development

npm WARN lifecycle The node binary used for scripts is C:\Program Files (x86)\Nodist\bin\node.exe but npm is using C:\Program Files (x86)\Nodist\v-x64\11.13.0\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> @ development C:\Users\hp\Desktop\test\blog
> mix

Error: You are using an unsupported version of Node. Please update to at least Node v12.14
    at assertSupportedNodeVersion (C:\Users\hp\Desktop\test\blog\node_modules\laravel-mix\src\Engine.js:6:15)
    at executeScript (C:\Users\hp\Desktop\test\blog\node_modules\laravel-mix\bin\cli.js:61:5)
    at Command.program.command.description.option.action (C:\Users\hp\Desktop\test\blog\node_modules\laravel-mix\bin\cli.js:47:13)
    at Command.listener [as _actionHandler] (C:\Users\hp\Desktop\test\blog\node_modules\commander\index.js:922:31)
    at Command._parseCommand (C:\Users\hp\Desktop\test\blog\node_modules\commander\index.js:1503:14)
    at Command._dispatchSubcommand (C:\Users\hp\Desktop\test\blog\node_modules\commander\index.js:1443:18)
    at Command._parseCommand (C:\Users\hp\Desktop\test\blog\node_modules\commander\index.js:1469:12)
    at Command.parse (C:\Users\hp\Desktop\test\blog\node_modules\commander\index.js:1292:10)
    at Command.parseAsync (C:\Users\hp\Desktop\test\blog\node_modules\commander\index.js:1318:10)
    at run (C:\Users\hp\Desktop\test\blog\node_modules\laravel-mix\bin\cli.js:50:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `mix`
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!     C:\Users\hp\AppData\Roaming\npm-cache\_logs\2021-09-03T16_33_47_852Z-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!     C:\Users\hp\AppData\Roaming\npm-cache\_logs\2021-09-03T16_33_47_899Z-debug.log

nodeのバージョンがサポート対象外らしい

\node_modules\laravel-mix\package.json
        "node": ">=12.14.0"

node 12.14.0以上が対象のため、現在のnodeバージョンを確認

C:\Users\hp\Desktop\test\blog>node -v
v11.13.0

nodeのバージョンをnode 12.14.0以上にすると解消されました。

C:\Users\hp\Desktop\test\blog>node -v
v14.17.6

C:\Users\hp\Desktop\test\blog>npm run dev
(省略)
✔ Compiled Successfully in 627ms
webpack compiled successfully
0
0
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
0
0