【问题标题】:What causes this webpack code 2 error and how to solve it?是什么导致了这个 webpack 代码 2 错误以及如何解决它?
【发布时间】:2019-06-10 18:19:20
【问题描述】:

简单的改动后甚至无法构建搭档

我在 Sidekick 中创建了一个新的 Core/TS 项目,我构建了应用程序并开发了一些东西,但后来我将图标更改为一个更好的图标(这需要一个新的构建,显然这种类型的更改没有 HMR),现在我无法构建我的应用程序(云构建,因为我没有 Android Studio)。

我检查了 /main/assets/app/ 并且图标在那里成功更改并且它们存在。

发生了什么?我该如何解决这个大问题?即使在简单的更改之后,我对所有这些严重错误的耐心瓶也被清空

我还尝试了“删除 .cloud 和文件夹目录”,并单击“清理云进程”,添加“清理”选项等... 但没有一个奏效。


我还用 node_modules.bin\update-ns-webpack --configs 更新了 webpack.config.js 文件 该文件已成功更新,但 没有 解决了问题,我仍然无法构建。

仍然无法在 Sidekick 中云构建我的应用程序。我也试过 tns platform remove android, tns install, etc, etc.... 都没有成功。

这是错误信息:

[00:00:18.521] [WARN]  Executing webpack failed with exit code 2.
[00:00:18.681] [ERROR] clean-webpack-plugin: /mnt/storage/builds/_/af8fe992d35e76b54f5523261a83dac973ffc9ed/5.3.4/5.3.1/Spread/platforms/android/app/src/main/assets/app/**/* has been removed.
Executing webpack failed with exit code 2.
'Build failed with error code 2'.
[19-06-10 19:13:56.767] Couldn't enable debugging for EP7333JKFA, Error: Couldn't enable debugging for EP7333JKFA
    at Errors.fail (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\common\errors.js:126:28)
    at Errors.failWithoutHelp (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\common\errors.js:136:21)
    at LiveSyncService.<anonymous> (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:253:30)
    at Generator.next (<anonymous>)
    at C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:13:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:9:12)
    at LiveSyncService.enableDebuggingCoreWithoutWaitingCurrentAction (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:250:16)
    at LiveSyncService.enableDebuggingCoreWithoutWaitingCurrentAction (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\common\decorators.js:67:47)
    at LiveSyncService.<anonymous> (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:290:25)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\Bridge\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\livesync-service.js:10:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
OUTPUT 2

编辑: 解决了 https://github.com/NativeScript/sidekick-feedback/issues/384#issuecomment-508028462

【问题讨论】:

  • 可能是权限问题。
  • @Narendra 什么是“许可问题”?以及如何解决?
  • 我的团队最近也遇到了 webpack + NativeScript 问题——我们最终将 package.json 中的 devDependency 更改为指向 nativescript-dev-webpack 的发布号(删除“next”)... @ 987654324@
  • @Doug 但我从未在我的package.json中使用“下一个”标签

标签: nativescript


【解决方案1】:

我知道这不是答案,但它也发生在我身上。我正在运行 Nativescript 5.4.1。我可以使用 webpack 构建,但是一旦我尝试使用 AOT 或 Uglify 运行,我就无法构建并且错误消息不是很有帮助。

【讨论】:

    【解决方案2】:

    尝试使用 nativescript-sidekick-GUI 删除和添加 'nativescript-dev-webpack'-plugin,这解决了我的问题...

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-02
    • 1970-01-01
    • 2011-07-03
    • 2021-06-25
    相关资源
    最近更新 更多