#0 0.939 > uni-app-template-v2@0.1.0 build:h5
#0 0.939 > cross-env NODE_ENV=production UNI_PLATFORM=h5 vue-cli-service uni-build
#0 0.939
#0 2.012
#0 2.014 - Start to compile the current project to the h5 platform...
#0 2.752 ERROR TypeError: compilation.getCache is not a function
#0 2.753 TypeError: compilation.getCache is not a function
#0 2.753 at /app/node_modules/.pnpm/copy-webpack-plugin@11.0.0_webpack@5.0.0-rc.6/node_modules/copy-webpack-plugin/dist/index.js:693:33
#0 2.753 at SyncHook.eval [as call] (eval at create (/app/node_modules/.pnpm/tapable@1.1.3/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
#0 2.753 at SyncHook.lazyCompileHook (/app/node_modules/.pnpm/tapable@1.1.3/node_modules/tapable/lib/Hook.js:154:20)
#0 2.753 at Compiler.newCompilation (/app/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/Compiler.js:630:30)
#0 2.753 at /app/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/Compiler.js:667:29
#0 2.753 at AsyncSeriesHook.eval [as callAsync] (eval at create (/app/node_modules/.pnpm/tapable@1.1.3/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
#0 2.753 at AsyncSeriesHook.lazyCompileHook (/app/node_modules/.pnpm/tapable@1.1.3/node_modules/tapable/lib/Hook.js:154:20)
#0 2.753 at Compiler.compile (/app/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/Compiler.js:662:28)
#0 2.753 at /app/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/Compiler.js:321:11
#0 2.753 at Compiler.readRecords (/app/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/Compiler.js:529:11)
#0 2.753 at /app/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/Compiler.js:318:10
#0 2.753 at AsyncSeriesHook.eval [as callAsync] (eval at create (/app/node_modules/.pnpm/tapable@1.1.3/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
#0 2.753 at AsyncSeriesHook.lazyCompileHook (/app/node_modules/.pnpm/tapable@1.1.3/node_modules/tapable/lib/Hook.js:154:20)
#0 2.753 at /app/node_modules/.pnpm/webpack@4.46.0/node_modules/webpack/lib/Compiler.js:315:19
#0 2.753 at AsyncSeriesHook.eval [as callAsync] (eval at create (/app/node_modules/.pnpm/tapable@1.1.3/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
#0 2.753 at AsyncSeriesHook.lazyCompileHook (/app/node_modules/.pnpm/tapable@1.1.3/node_modules/tapable/lib/Hook.js:154:20)
#0 2.770 ELIFECYCLE Command failed with exit code 1.
------
failed to solve: executor failed running [/bin/sh -c pnpm run build]: exit code: 1
御焱
- 发布:2023-05-04 14:53
- 更新:2023-08-12 13:39
- 阅读:1207
1 个回复
Forrester
我也遇到了同样的问题,应该是copy-webpack-plugin的原因.
我在尝试更换了vue-cli中自带的copy-webpack-plugin和版本之后,项目能正常编译了.
希望对你有帮助.