#1073·nodegui

Error: Cannot find module './dist'

Author: danilobatistaqueirozCreated Sep 2, 2025Updated Sep 18, 2025

See below at the end of page, my latest comment, please!


I'm following the tutorial, and after the commands: npx nodegui-packer --init chrono npm run build npx nodegui-packer --pack ./dist

I'm trying to run the app:
with this command:
./chrono/deploy/linux/build/chrono/AppRun or with this command: ./deploy/linux/build/chrono/Application-x86_64.AppImage

I get this error: Cannot find module './dist'


My environment:

Description: Ubuntu 24.04.2 LTS Release: 24.04 Codename: noble

Node v22.0.0 npm 10.6.0


Commands Output:

npx nodegui-packer --pack ./dist

$ npx nodegui-packer --pack ./dist

> [email protected] npx
> nodegui-packer --pack ./dist

(node:302739) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
cleaning build directory at /dados/projects/node/chrono/deploy/linux/build
creating build directory at /dados/projects/node/chrono/deploy/linux/build
copying qode
copying dist
running linuxdeployqt
stderr: linuxdeployqt 4 (commit 8b3ded6), build 571 built on 2018-10-07 20:58:12 UTC

stderr: Not using FHS-like mode
app-binary: "/dados/projects/node/chrono/deploy/linux/build/chrono/qode"
appDirPath: "/dados/projects/node/chrono/deploy/linux/build/chrono"
relativeBinPath: "qode"

stderr: Log: Deploying the following libraries: ("/dados/projects/node/chrono/deploy/linux/build/chrono/qode")

stderr: Log:  copied: "/lib/x86_64-linux-gnu/libpcre2-8.so.0"
Log:  to "/dados/projects/node/chrono/deploy/linux/build/chrono/lib//libpcre2-8.so.0"

stderr: Log: Checking rpath in "/dados/projects/node/chrono/deploy/linux/build/chrono/lib/libpcre2-8.so.0"

stderr: Log: Changing rpath in "/dados/projects/node/chrono/deploy/linux/build/chrono/lib/libpcre2-8.so.0" to "$ORIGIN"

stderr: Log: Checking rpath in "/dados/projects/node/chrono/deploy/linux/build/chrono/qode"

stderr: Log: Changing rpath in "/dados/projects/node/chrono/deploy/linux/build/chrono/qode" to "$ORIGIN/lib"

stderr: appimagetool, continuous build (commit d185526), build 1855 built on 2018-10-07 20:18:45 UTC

stderr: Name: Application
Icon: default
Exec: AppRun %F
Comment: Edit this default file
Type: Application
Categories: Utility;

stderr: /dados/projects/node/chrono/deploy/linux/build/chrono/qode used for determining architecture x86_64

stderr: /dados/projects/node/chrono/deploy/linux/build/chrono/lib/libpcre2-8.so.0 used for determining architecture x86_64
Using architecture x86_64

stderr: App name for filename: Application
Deleting pre-existing .DirIcon
Creating .DirIcon symlink based on information from desktop file
Generating squashfs...

stdout: Parallel mksquashfs: Using 8 processors
Creating 4.0 filesystem on Application-x86_64.AppImage, block size 131072.
[===============================================================|] 498/498 100%
stdout: 

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
        compressed data, compressed metadata, compressed fragments, compressed xattrs
        duplicates are removed
Filesystem size 22318.76 Kbytes (21.80 Mbytes)
        35.42% of uncompressed filesystem size (63009.47 Kbytes)
Inode table size 1530 bytes (1.49 Kbytes)
        62.99% of uncompressed inode table size (2429 bytes)
Directory table size 207 bytes (0.20 Kbytes)
        76.10% of uncompressed directory table size (272 bytes)
Number of duplicate files found 2
Number of inodes 14
Number of files 9
Number of fragments 1
Number of symbolic links  2
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 3
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)

stderr: Embedding ELF...

stderr: Marking the AppImage as executable...
Embedding MD5 digest

stderr: Success

Please consider submitting your AppImage to AppImageHub, the crowd-sourced
central directory of available AppImages, by opening a pull request
at https://github.com/AppImage/appimage.github.io

stdout: Desktop file: /dados/projects/node/chrono/deploy/linux/build/chrono/default.desktop
/dados/projects/node/chrono/deploy/linux/build/chrono should be packaged as Application-x86_64.AppImage
Size of the embedded runtime: 187784 bytes

stderr: Log: ret 0
Log: WEXITSTATUS(ret) 0

Build successful. Find the AppImage at /dados/projects/node/chrono/deploy/linux/build/chrono. Look for an executable file with extension .AppImage

$ /dados/projects/node/chrono/deploy/linux/build/chrono/AppRun

$ /dados/projects/node/chrono/deploy/linux/build/chrono/AppRun
node:internal/modules/cjs/loader:998
  throw err;
  ^

Error: Cannot find module './dist'
Require stack:
- /dados/projects/node/chrono/deploy/linux/build/chrono/index.js
- internal/preload
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/dados/projects/node/chrono/deploy/linux/build/chrono/index.js:6:1)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/dados/projects/node/chrono/deploy/linux/build/chrono/index.js',
    'internal/preload'
  ]
}

Node.js v18.12.1

### $ /dados/projects/node/chrono/deploy/linux/build/chrono/Application-x86_64.AppImage

$ /dados/projects/node/chrono/deploy/linux/build/chrono/Application-x86_64.AppImage 
node:internal/modules/cjs/loader:998
  throw err;
  ^

Error: Cannot find module './dist'
Require stack:
- /tmp/.mount_ApplicngpMoI/index.js
- internal/preload
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/tmp/.mount_ApplicngpMoI/index.js:6:1)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/tmp/.mount_ApplicngpMoI/index.js', 'internal/preload' ]
}

Node.js v18.12.1

Directory Structure

Image

** Another Picture of my Directory Strucutre**

Image