Saya guna npx create-next-app ./ 创建了一个新的 next.js 应用程序 ./
Saya tidak menyentuh mana-mana kod atau membukanya dalam editor.
Apabila menjalankan apl ini menggunakan npm run dev
Saya mendapat amaran yang sangat panjang ini.
$ npm run dev > test@0.1.0 dev > next dev - ready started server on 0.0.0.0:3000, url: http://localhost:3000 - event compiled client and server successfully in 1605 ms (20 modules) - wait compiling... - event compiled client and server successfully in 593 ms (20 modules) - wait compiling /page (client and server)... - warn ./node_modules/next/dist/client/add-base-path.js There are multiple modules with names that only differ in casing. This can lead to unexpected behavior when compiling on a filesystem with other case-semantic. Use equal casing. Compare these module identifiers: * javascript/auto|C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\compiled\@next\react-refresh-utils\dist\loader.js!C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[6].oneOf[4].use[2]!C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\client\add-base-path.js|app-client Used by 3 module(s), i. e. javascript/auto|C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\compiled\@next\react-refresh-utils\dist\loader.js!C:\Users\Admin\Desktop\Desktop\WD\NEXTjs\test\test\node_modules\next\dist\build\.................
Halaman dimuatkan.
Saya rasa anda hanya perlu mengalih keluar
./
dan jalankan arahan.npx create-next-app@latest
Selepas itu, apabila arahan meminta nama projek, tulis sahaja
.
dan tekan Enter.Saya jumpa masalahnya. Next.js tidak suka meletakkan aplikasi dalam folder Desktop/desktop/..., jadi ia menimbulkan ralat. Saya baru sahaja menukar nama folder dan ia berfungsi.