node.jsnpmrolluplightning

(plugin Rollup Core) Error: Could not load /Users/Naseem/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js


How can I fix this issue?

$ 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

Solution

  • I managed to work around this problem by relocating the workspace to the same drive (from D: to C: in my case).

    Before:

    
       D:\work\myproj\com.work.Test\src\index.js → build\appBundle.js...
        [!] (plugin Rollup Core) Error: Could not load /Users/myuser/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js (imported by D:\work\myproj\com.work.Test\node_modules\wpe-lightning-sdk\src\Lightning\index.js): ENOENT: no such file or directory, open 'D:\Users\myuser\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\alias\wpe-lightning.js'
        Error: Could not load /Users/myuser/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js (imported by D:\work\myproj\com.work.Test\node_modules\wpe-lightning-sdk\src\Lightning\index.js): ENOENT: no such file or directory, open 'D:\Users\myuser\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\alias\wpe-lightning.js'
        
        (node:28464) UnhandledPromiseRejectionWarning: Error: Error: Command failed with exit code 1: C:\Users\myuser\AppData\Roaming\npm\node_modules\wpe-lightning-cli\node_modules\.bin\rollup -c C:\Users\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
        at C:\Users\myuser\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\helpers\build.js:150:13
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        (node:28464) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
        (node:28464) [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.
    
    

    After:

    
        C:\work\proj\com.work.Test>lng build
        √ Testing internet connection..
        √ Verifying if your installation of Lightning-CLI is up to date.
        √ Removing "C:\work\proj\com.work.Test\build" folder
        √ Ensuring "C:\work\proj\com.work.Test\build" folder exists
        √ Copying support files to "C:\work\proj\com.work.Test\build"
        √ Copying static assets to "C:\work\proj\com.work.Test\build"
        √ Copying settings.json to "C:\work\proj\com.work.Test\build"
        √ Copying metadata.json to "C:\work\proj\com.work.Test\build"
        √ Building ES6 appBundle and saving to "C:\work\proj\com.work.Test\build"
    
    

    Conclusion: Looks like the path was invalid ... src/alias/ does not exist.