0

experts, I got below warning from when I tried to make a executable file with nodejs+express app. The resulted exe file in windows has an error also.

Please review and give your advice to resolve this.

Warning message in making an exe file :

> pkg@5.8.0
> Warning Cannot include file %1 into executable.
  The file must be distributed with executable as %2.
  %1: node_modules\open\xdg-open
  %2: path-to-executable/xdg-open

Error message in running the exe file :
C:\snapshot\cass\node_modules\streamroller\lib\RollingFileWriteStream.js:282
          throw e;
          ^

Error: Cannot mkdir in a snapshot. Try mountpoints instead.
    at mkdirFailInSnapshot (pkg/prelude/bootstrap.js:1636:7)
    at Object.mkdirSync (pkg/prelude/bootstrap.js:1648:12)
    at mkdir (C:\snapshot\cass\node_modules\streamroller\lib\RollingFileWriteStream.js:270:19)
    at RollingFileStream._renewWriteStream (C:\snapshot\cass\node_modules\streamroller\lib\RollingFileWriteStream.js:299:5)
    at new RollingFileWriteStream (C:\snapshot\cass\node_modules\streamroller\lib\RollingFileWriteStream.js:94:10)
    at new RollingFileStream (C:\snapshot\cass\node_modules\streamroller\lib\RollingFileStream.js:18:5)
    at openTheStream (C:\snapshot\cass\node_modules\log4js\lib\appenders\file.js:64:20)
    at fileAppender (C:\snapshot\cass\node_modules\log4js\lib\appenders\file.js:84:16)
    at Object.configure (C:\snapshot\cass\node_modules\log4js\lib\appenders\file.js:144:10)
    at C:\snapshot\cass\node_modules\log4js\lib\appenders\index.js:117:29

Node.js v18.5.0

I re-install open.js and pkg.js with the latest one, but still have the same problem.

Mike 'Pomax' Kamermans
  • 49,297
  • 16
  • 112
  • 153
econuri
  • 21
  • 2
  • 1
    Then it's time to [do some debugging](/help/how-to-ask) first: create an [mcve] by removing as much as possible from your code to the point where it does almost nothing, but _does_ compile to a working exe, and then when you put back the last code you removed, it _doesn't_ compiled to a working exe anymore. Now you've found the (first) problem, and you can take it from there. – Mike 'Pomax' Kamermans Mar 03 '23 at 00:47
  • Please provide enough code so others can better understand or reproduce the problem. – Community Mar 06 '23 at 01:46

1 Answers1

0

Cannot include file %1 into executable. The file must be distributed with executable as %2.

You have to put the executable in folder

%2: path-to-executable/xdg-open.

paransaik
  • 96
  • 1
  • 6