1

我该如何解决这个问题?

$ lng build

√ Removing "E:\workspace\xxx\xxx\build" folder

√ Ensuring "E:\workspace\xxx\xxx\build" folder exists

√ Copying support files to "E:\workspace\xxx\xxx\build"

- Copying static assets to "E:\workspace\xxx\xxx\build"cp: no such file or directory: ./static
√ Copying static assets to "E:\workspace\xxx\xxx\build"

√ Copying settings.json to "E:\workspace\xxx\xxx\build"

√ Copying metadata.json to "E:\workspace\xxx\xxx\build"

× Error while creating ES6 bundle (see log)


E:\workspace\xxx\xxx\src\index.js → build\appBundle.js...
[!] (plugin Rollup Core) Error: Could not load /Users/Naseem/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js (imported by E:\workspace\xxx\xxx\node_modules\wpe-lightning-sdk\src\Lightning\index.js): ENOENT: no such file or directory, open 'E:\Users\Naseem\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\alias\wpe-lightning.js'
Error: Could not load /Users/Naseem/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js (imported by E:\workspace\xxx\xxx\node_modules\wpe-lightning-sdk\src\Lightning\index.js): ENOENT: no such file or directory, open 'E:\Users\Naseem\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\alias\wpe-lightning.js'

(node:7472) UnhandledPromiseRejectionWarning: Error: Error: Command failed with exit code 1: C:\Users\Naseem\AppData\Roaming\npm\node_modules\wpe-lightning-cli\node_modules\.bin\rollup -c C:\Users\Naseem\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\configs\rollup.es6.config.js --input E:\workspace\xxx\xxx\src\index.js
--file E:\workspace\xxx\xxx\build\appBundle.js --name APP_com_epam_lgi
    at execa.then.catch.e (C:\Users\Naseem\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\helpers\build.js:150:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:7472) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:7472) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


using npm -v > 6.13.4
using node -v > v10.19.0
4

1 回答 1

0

我设法通过将工作区重新定位到同一个驱动器(在我的情况下从 D: 到 C:)来解决这个问题。

前:

   D:\work\myproj\com.work.Test\src\index.js → build\appBundle.js...
    [!](插件汇总核心)错误:无法加载 /Users/myuser/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js(由 D:\work\myproj 导入\com.work.Test\node_modules\wpe-lightning-sdk\src\Lightning\index.js):ENOENT:没有这样的文件或目录,打开 'D:\Users\myuser\AppData\Roaming\npm\node_modules\wpe -lightning-cli\src\别名\wpe-lightning.js'
    错误:无法加载 /Users/myuser/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js(由 D:\work\myproj\com.work.Test\node_modules 导入\wpe-lightning-sdk\src\Lightning\index.js):ENOENT:没有这样的文件或目录,打开 'D:\Users\myuser\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\alias \wpe-lightning.js'
    
    (节点:28464)UnhandledPromiseRejectionWarning:错误:错误:命令失败,退出代码 1:C:\Users\myuser\AppData\Roaming\npm\node_modules\wpe-lightning-cli\node_modules\.bin\rollup -c C:\用户\myuser\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\configs\rollup.es6.config.js --input D:\work\myproj\com.work.Test\src\index.js --file D:\work\myproj\com.work.Test\build\appBundle.js --name APP_com_work_Test
    在 C:\Users\myuser\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\helpers\build.js:150:13
    在 processTicksAndRejections (internal/process/task_queues.js:97:5)
    (节点:28464)UnhandledPromiseRejectionWarning:未处理的承诺拒绝。此错误源于在没有 catch 块的情况下抛出异步函数内部,或拒绝未使用 .catch() 处理的承诺。要在未处理的 Promise 拒绝时终止节点进程,请使用 CLI 标志 `--unhandled-rejections=strict`(请参阅 https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode)。(拒绝编号:3)
    (节点:28464)[DEP0018] DeprecationWarning:不推荐使用未处理的承诺拒绝。将来,未处理的 Promise 拒绝将使用非零退出代码终止 Node.js 进程。

后:

    C:\work\proj\com.work.Test>lng 构建
    √ 测试网络连接..
    √ 验证您安装的 Lightning-CLI 是否是最新的。
    √ 删除“C:\work\proj\com.work.Test\build”文件夹
    √ 确保“C:\work\proj\com.work.Test\build”文件夹存在
    √ 将支持文件复制到“C:\work\proj\com.work.Test\build”
    √ 复制静态资源到“C:\work\proj\com.work.Test\build”
    √ 将 settings.json 复制到“C:\work\proj\com.work.Test\build”
    √ 将 metadata.json 复制到“C:\work\proj\com.work.Test\build”
    √ 构建 ES6 appBundle 并保存到“C:\work\proj\com.work.Test\build”

结论:看起来路径无效... src/alias/ 不存在。

于 2020-08-19T17:42:55.260 回答