😺

[next]nextが起動できん

2021/12/26に公開
 ~/W/d/next-visualize-audio    npm run dev                2021-12-26 04:58:40

> next-visualize-audio@ dev /Users/tanokentaro/Workspace/develop/next-visualize-audio
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
Error: Not supported
    at Object.loadConfig [as default] (/Users/tanokentaro/Workspace/develop/next-visualize-audio/node_modules/next/dist/server/config.js:399:74)
    at async NextServer.loadConfig (/Users/tanokentaro/Workspace/develop/next-visualize-audio/node_modules/next/dist/server/next.js:116:22)
    at async NextServer.prepare (/Users/tanokentaro/Workspace/develop/next-visualize-audio/node_modules/next/dist/server/next.js:98:24)
    at async /Users/tanokentaro/Workspace/develop/next-visualize-audio/node_modules/next/dist/cli/next-dev.js:130:9
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! next-visualize-audio@ dev: `next dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the next-visualize-audio@ 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/tanokentaro/.npm/_logs/2021-12-26T04_58_46_294Z-debug.log
 !  ~/W/d/next-visualize-audio                   615ms  2021-12-26 04:58:46

原因
https://nextjs.org/docs/getting-started

システム要求
Node.js12.22.0以降
MacOS、Windows(WSLを含む)、およびLinuxがサポートされています

nodeのバージョン変更を試す
https://stackoverflow.com/questions/69774152/failed-to-load-next-config-js
https://chusotsu-program.com/npm-run-dev-error/

 ~/W/d/next-visualize-audio    nodebrew ls                2021-12-26 05:29:05
v14.0.0
v16.10.0
v17.3.0

current: v16.10.0
~/W/d/next-visualize-audio    

nodeのバージョンを変更したつもりが変わっていない

 ~/W/d/next-visualize-audio    nodebrew ls                2021-12-26 05:39:35
v14.0.0
v16.10.0
v17.3.0

current: v14.0.0
~/W/d/next-visualize-audio                               2021-12-26 05:39:36
~/W/d/next-visualize-audio                               2021-12-26 05:39:37
~/W/d/next-visualize-audio                               2021-12-26 05:39:37
~/W/d/next-visualize-audio    node -v                    2021-12-26 05:39:37
v12.16.3
~/W/d/next-visualize-audio                               2021-12-26 05:39:44
~/W/d/next-visualize-audio                               2021-12-26 05:39:44
~/W/d/next-visualize-audio       

パスを通す
https://qiita.com/hondy12345/items/975878f4dbf33c8821af

~/.config/fish/config.fish

set -x PATH $HOME/.nodebrew/current/bin $PATH

shell再起動

成功

 ~/W/d/next-visualize-audio    npm run dev       4650ms  2021-12-26 06:03:55

> next-visualize-audio@ dev /Users/tanokentaro/Workspace/develop/next-visualize-audio
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
event - compiled client and server successfully in 3.4s (171 modules)
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

wait  - compiling / (client and server)...
event - compiled client and server successfully in 457 ms (189 modules)

Discussion