小编Lun*_*712的帖子

webpack 5 错误“无法解析‘uglify-js’、‘@swc/core’、‘esbuild’

我在 webpack 5、express、github 操作中遇到一些错误。我使用 github 操作是因为想使用 github 秘密。另外,我使用 webpack 因为使用了代码中的秘密。

无论如何,我在下面遇到了错误,

ERROR in ./node_modules/terser-webpack-plugin/dist/utils.js 479:6-26
Module not found: Error: Can't resolve 'uglify-js' in '/Users/luna/workspace/express_api/node_modules/terser-webpack-plugin/dist'
@ ./node_modules/terser-webpack-plugin/dist/index.js 27:4-22
@ ./webpack.config.js 2:21-53
@ ./app.js 13:15-45

ERROR in ./node_modules/terser-webpack-plugin/dist/utils.js 557:14-34
Module not found: Error: Can't resolve '@swc/core' in '/Users/luna/workspace/express_api/node_modules/terser-webpack-plugin/dist'
@ ./node_modules/terser-webpack-plugin/dist/index.js 27:4-22
@ ./webpack.config.js 2:21-53
@ ./app.js 13:15-45

ERROR in ./node_modules/terser-webpack-plugin/dist/utils.js 635:18-36
Module not found: Error: Can't resolve 'esbuild' in '/Users/luna/workspace/express_api/node_modules/terser-webpack-plugin/dist'
@ ./node_modules/terser-webpack-plugin/dist/index.js 27:4-22
@ ./webpack.config.js 2:21-53
@ ./app.js 13:15-45
Run Code Online (Sandbox Code Playgroud)

此外,还收到了 15 条警告。如果您想要警告,请告诉我。 …

node.js express webpack github-actions webpack-5

5
推荐指数
1
解决办法
4633
查看次数

标签 统计

express ×1

github-actions ×1

node.js ×1

webpack ×1

webpack-5 ×1