我創建了一個默認的反應應用程式,npx create-react-app app-name --template typescript但我的應用程式不作業。錯誤:
Html Webpack Plugin:
Error: Child compilation failed:
Module build failed (from ../../../#Node/authorization/6. crypto-converter/node_modules/html-webpack-pl ugin/lib/loader.js):
Error: Cannot find module 'C:\#Node\authorization\6. crypto-converter\node_modules\html-webpack-plugin\ lib\loader.js'
Require stack:
- C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\loadLoader.js
- C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\LoaderRunner.js
- C:\#Node\authorization\6. crypto-converter\node_modules\webpack\lib\NormalModule.js
- C:\#Node\authorization\6. crypto-converter\node_modules\webpack-manifest-plugin\dist\index.js
- C:\#Node\authorization\6. crypto-converter\node_modules\react-scripts\config\webpack.config.js
- C:\#Node\authorization\6. crypto-converter\node_modules\react-scripts\scripts\start.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at loadLoader (C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\loadLoader. js:19:17)
at iteratePitchingLoaders (C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib \LoaderRunner.js:182:2)
at runLoaders (C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\LoaderRunne r.js:397:2)
at NormalModule._doBuild (C:\#Node\authorization\6. crypto-converter\node_modules\webpack\lib\Normal Module.js:812:3)
at NormalModule.build (C:\#Node\authorization\6. crypto-converter\node_modules\webpack\lib\NormalMod ule.js:956:15)
at C:\#Node\authorization\6. crypto-converter\node_modules\webpack\lib\Compilation.js:1367:12
ModuleBuildError: Module build failed (from ../../../#Node/authorization/6. crypto-converter/node_modul es/html-webpack-plugin/lib/loader.js):
Error: Cannot find module 'C:\#Node\authorization\6. crypto-converter\node_modules\html-webpack-plugin\ lib\loader.js'
Require stack:
- C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\loadLoader.js
- C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\LoaderRunner.js
- C:\#Node\authorization\6. crypto-converter\node_modules\webpack\lib\NormalModule.js
- C:\#Node\authorization\6. crypto-converter\node_modules\webpack-manifest-plugin\dist\index.js
- C:\#Node\authorization\6. crypto-converter\node_modules\react-scripts\config\webpack.config.js
- C:\#Node\authorization\6. crypto-converter\node_modules\react-scripts\scripts\start.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at loadLoader (C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\loadLoader. js:19:17)
at iteratePitchingLoaders (C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib \LoaderRunner.js:182:2)
at runLoaders (C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\LoaderRunne r.js:397:2)
at NormalModule._doBuild (C:\#Node\authorization\6. crypto-converter\node_modules\webpack\lib\Normal Module.js:812:3)
at NormalModule.build (C:\#Node\authorization\6. crypto-converter\node_modules\webpack\lib\NormalMod ule.js:956:15)
at C:\#Node\authorization\6. crypto-converter\node_modules\webpack\lib\Compilation.js:1367:12
at processResult (C:\#Node\authorization\6. crypto-converter\node_modules\webpack\lib\NormalModule.j s:751:19)
at C:\#Node\authorization\6. crypto-converter\node_modules\webpack\lib\NormalModule.js:853:5
at C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\LoaderRunner.js:399:11
at C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\LoaderRunner.js:185:11
at loadLoader (C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\loadLoader. js:33:11)
at iteratePitchingLoaders (C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib \LoaderRunner.js:182:2)
at runLoaders (C:\#Node\authorization\6. crypto-converter\node_modules\loader-runner\lib\LoaderRunne r.js:397:2)
...`
在此之前我看到警告:
(node:2720) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:2720) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
我試過:
- 創建新應用
- 在其他目錄中創建應用程式
- 洗掉 node.js
- 安裝其他版本的 node.js(16.14.0、17.4.0、16.13.2 - 活動)
uj5u.com熱心網友回復:
解決方案:安裝[email protected]。如果您知道如何解決 [email protected] 的問題,請寫信。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/425760.html
