Heim > Fragen und Antworten > Hauptteil
Ich benutze npx create-next-app ./ 创建了一个新的 next.js 应用程序 ./
Ich habe keinen Teil des Codes berührt oder ihn überhaupt in einem Editor geöffnet.
Wenn ich diese App mit npm run dev
ausführe, erhalte ich diese sehr langen Warnungen.
$ 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\.................
Seite geladen.
P粉4884647312024-02-22 12:49:19
我认为您只需要删除 ./
然后运行命令即可。
npx create-next-app@latest
之后,当命令询问项目名称时,只需写入 .
并按 Enter。
P粉3409802432024-02-22 12:10:06
我发现了问题。 Next.js 不喜欢将应用程序放在 Desktop/desktop/... 文件夹中,因此它会抛出错误。我刚刚更改了文件夹名称并且它起作用了。