How can I generate botpress binaries?

title says. I want to generate botpress binaries from source for the current master branch because there are some important bug fixes that aren’t part of the currently released binaries.

@Aung_Pyae_Kyaw please see How to make EXE after building source code (after yarn and yarn build)

On the other hand, it seems that a new version is immenent

1 Like

Hi @asashour,
Thanks for the reply. I followed the answer you mentioned above and now I have a problem with installing modules into my binary build.The errors when I got when I run yarn package --linux are

'package-module analytics'...
[module-builder] Installing production modules...
[module-builder] Error packaging module: Command failed: yarn install --modules-folder node_production_modules --production --no-lockfile --ignore-scripts --force
env: node: No such file or directory
 yarn install --modules-folder node_production_modules --production --no-lockfile --ignore-scripts --force env: node: No such file or directory

[module-builder] Cleaning up temporary files...

[15:37:10] Finished 'package-module analytics' after 1.84 s
[15:37:10] Starting 'package-module basic-skills'...
[module-builder] Installing production modules...
[module-builder] Error packaging module: Command failed: yarn install --modules-folder node_production_modules --production --no-lockfile --ignore-scripts --force
env: node: No such file or directory
 yarn install --modules-folder node_production_modules --production --no-lockfile --ignore-scripts --force env: node: No such file or directory

[module-builder] Cleaning up temporary files...

for each built-in module. Thanks.

@Aung_Pyae_Kyaw

env: node: No such file or directory

Have you installed node? If not, please install 10.11.0.

Let’s start from the beginning, at the root folder, have you built the project?

yarn && yarn build

It takes some time, then in modules/channel/messenger, you can use the yarn package --linux

Hi @asashour, Thank for the replay. I tried with the steps that you said above but it’s not working. I add the logs of the yarn build. Please kindly take a look. Thank.

➜  botpress git:(master) yarn
yarn install v1.19.2
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
warning " > bluebird-global@1.0.1" has unmet peer dependency "bluebird@*".
[5/5] 🔨  Building fresh packages...
✨  Done in 11.04s.
➜  botpress git:(master) yarn build
yarn run v1.19.2
$ yarn cmd build
$ yarn run gulp build
$ /Users/aungpyaekyaw/Data/Projects/3party/botpress/botpress/bp-source/botpress/node_modules/.bin/gulp build
[08:58:03] Using gulpfile ~/Data/Projects/3party/botpress/botpress/bp-source/botpress/gulpfile.js
[08:58:03] Starting 'build'...
[08:58:03] Starting 'maybeFetchPro'...
[08:58:03] Finished 'maybeFetchPro' after 13 ms
[08:58:03] Starting 'writeMetadata'...
[08:58:03] Finished 'writeMetadata' after 9.88 ms
[08:58:03] Starting 'compileTypescript'...
[08:58:10] Finished 'compileTypescript' after 7.83 s
[08:58:10] Starting 'buildSchemas'...
[08:58:13] Finished 'buildSchemas' after 2.87 s
[08:58:13] Starting 'createOutputDirs'...
[08:58:13] Finished 'createOutputDirs' after 13 ms
[08:58:13] Starting 'copyJs'...
[08:58:13] Finished 'copyJs' after 19 ms
[08:58:13] Starting 'copyBinaries'...
[08:58:13] Finished 'copyBinaries' after 1.53 ms
[08:58:13] Starting 'build:shared'...
[08:58:13] Starting 'cleanShared'...
[08:58:13] Finished 'cleanShared' after 1.36 ms
[08:58:13] Starting 'sharedBuild'...
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ cross-env NODE_ENV=production node ./webpack.config.js --compile --nomap
[08:58:20] Shared    9 modules
[08:58:21] Finished 'sharedBuild' after 7.81 s
[08:58:21] Finished 'build:shared' after 7.81 s
[08:58:21] Starting 'initStudio'...
[08:58:22] Finished 'initStudio' after 712 ms
[08:58:22] Starting 'buildModuleBuilder'...
[1/4] Resolving packages...
success Already up-to-date.
$ ./node_modules/.bin/babel src --out-dir bin --extensions ".ts,.js"
Successfully compiled 6 files with Babel.

[08:58:24] Finished 'buildModuleBuilder' after 2.32 s
[08:58:24] Starting 'cleanSdk'...
[08:58:24] Finished 'cleanSdk' after 3.82 ms
[08:58:24] Starting 'build-module analytics'...
[08:58:33] Finished 'build-module analytics' after 9.23 s
[08:58:33] Starting 'build-module basic-skills'...
[08:58:46] Finished 'build-module basic-skills' after 12 s
[08:58:46] Starting 'build-module builtin'...
[08:58:51] Finished 'build-module builtin' after 5.11 s
[08:58:51] Starting 'build-module channel-messenger'...
[08:58:58] Finished 'build-module channel-messenger' after 6.81 s
[08:58:58] Starting 'build-module channel-slack'...
[08:59:04] Finished 'build-module channel-slack' after 6.74 s
[08:59:04] Starting 'build-module channel-smooch'...
[08:59:10] Finished 'build-module channel-smooch' after 6.09 s
[08:59:10] Starting 'build-module channel-teams'...
[08:59:17] Finished 'build-module channel-teams' after 6.84 s
[08:59:17] Starting 'build-module channel-telegram'...
[08:59:24] Finished 'build-module channel-telegram' after 6.63 s
[08:59:24] Starting 'build-module channel-web'...
[08:59:41] Finished 'build-module channel-web' after 17 s
[08:59:41] Starting 'build-module code-editor'...
[09:00:01] Finished 'build-module code-editor' after 21 s
[09:00:01] Starting 'build-module examples'...
[09:00:09] Finished 'build-module examples' after 7.53 s
[09:00:09] Starting 'build-module extensions'...
[09:00:20] Finished 'build-module extensions' after 11 s
[09:00:20] Starting 'build-module hitl'...
[09:00:30] Finished 'build-module hitl' after 11 s
[09:00:30] Starting 'build-module misunderstood'...
[09:00:41] Finished 'build-module misunderstood' after 10 s
[09:00:41] Starting 'build-module nlu-extras'...
[09:00:49] Finished 'build-module nlu-extras' after 8.06 s
[09:00:49] Starting 'build-module nlu-testing'...
[09:00:58] Finished 'build-module nlu-testing' after 8.99 s
[09:00:58] Starting 'build-module nlu'...
[09:01:13] Finished 'build-module nlu' after 16 s
[09:01:13] Starting 'build-module qna'...
[09:01:25] Finished 'build-module qna' after 12 s
[09:01:25] Starting 'build-module testing'...
[09:01:35] Finished 'build-module testing' after 9.57 s
[09:01:35] Starting 'build-module uipath'...
[09:01:41] Finished 'build-module uipath' after 6.28 s
[09:01:41] Starting 'build:studio'...
[09:01:41] Starting 'buildStudio'...
clean-webpack-plugin: /Users/aungpyaekyaw/Data/Projects/3party/botpress/botpress/bp-source/botpress/src/bp/ui-studio/public has been removed.
[hardsource:224e7948] Deleted 74 MB. Using 0 MB of disk space.
[hardsource:224e7948] Tracking node dependencies with: yarn.lock.
[hardsource:224e7948] Reading from cache 224e7948...
[hardsource:224e7948] Cache is corrupted.
Error: EEXIST: file already exists, mkdir '/Users/aungpyaekyaw/Data/Projects/3party/botpress/botpress/bp-source/botpress/src/bp/ui-studio/node_modules/.cache/hard-source/224e7948b777c23a45e32b97a4e17237935c11573fb0344970f3f922b02eb86a/module-resolve'
[09:02:11] Finished 'buildStudio' after 30 s
[09:02:11] Starting 'cleanStudio'...
[09:02:11] Finished 'cleanStudio' after 52 ms
[09:02:11] Starting 'cleanStudioAssets'...
[09:02:11] Finished 'cleanStudioAssets' after 3.11 ms
[09:02:11] Starting 'copyStudio'...
[09:02:11] Finished 'copyStudio' after 442 ms
[09:02:11] Finished 'build:studio' after 30 s
[09:02:11] Starting 'build:admin'...
[09:02:11] Starting 'buildAdmin'...
Wrote 1 CSS files to /Users/aungpyaekyaw/Data/Projects/3party/botpress/botpress/bp-source/botpress/src/bp/ui-admin/src/
The following changes are being made to your tsconfig.json file:
  - compilerOptions.baseUrl must not be set (absolute imports are not supported (yet))
  - compilerOptions.paths must not be set (aliased imports are not supported)

[hardsource:b5b8fca6] Deleted 109 MB. Using 0 MB of disk space.
[hardsource:b5b8fca6] Tracking node dependencies with: yarn.lock.
[hardsource:b5b8fca6] Reading from cache b5b8fca6...
[hardsource:b5b8fca6] Cache is corrupted.
Error: EEXIST: file already exists, mkdir '/Users/aungpyaekyaw/Data/Projects/3party/botpress/botpress/bp-source/botpress/src/bp/ui-admin/node_modules/.cache/hard-source/b5b8fca65bb2cfab78b39e102f24004a503628e8f8b3c3f52f2364a5a2207ee0/module-resolve'
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
[09:02:46] Finished 'buildAdmin' after 35 s
[09:02:46] Starting 'copyAdmin'...
[09:02:46] Finished 'copyAdmin' after 81 ms
[09:02:46] Finished 'build:admin' after 35 s
[09:02:46] Finished 'build' after 4.72 min
✨  Done in 288.74s.
➜  botpress git:(master) cd modules/channel-messenger 
➜  channel-messenger git:(master) yarn package --linux
yarn run v1.19.2
$ node ../../build/module-builder/bin/entry package --linux
[module-builder] Error packaging module: Command failed: yarn install --modules-folder node_production_modules --production --no-lockfile --ignore-scripts --force
env: node: No such file or directory
 yarn install --modules-folder node_production_modules --production --no-lockfile --ignore-scripts --force env: node: No such file or directory

✨  Done in 2.07s.
➜  channel-messenger git:(master) node -v
v10.11.0
➜  channel-messenger git:(master) 

@Aung_Pyae_Kyaw: not sure if it is the root cause, but please delete src\bp\ui-admin\node_modules and try again.

@asashour Thank for the reply. I delete the node_module directory as you said above but it’s not still working with the same error message. I attached the log output again.

yarn install v1.19.2
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.55s.
yarn run v1.19.2
$ yarn cmd build
$ yarn run gulp build
$ /Users/aungpyaekyaw/Data/Projects/3party/botpress/botpress/bp-source/botpress/node_modules/.bin/gulp build
[15:10:31] Using gulpfile ~/Data/Projects/3party/botpress/botpress/bp-source/botpress/gulpfile.js
[15:10:31] Starting 'build'...
[15:10:31] Starting 'maybeFetchPro'...
[15:10:31] Finished 'maybeFetchPro' after 16 ms
[15:10:31] Starting 'writeMetadata'...
[15:10:31] Finished 'writeMetadata' after 8.13 ms
[15:10:31] Starting 'compileTypescript'...
[15:10:39] Finished 'compileTypescript' after 8.12 s
[15:10:39] Starting 'buildSchemas'...
[15:10:42] Finished 'buildSchemas' after 2.99 s
[15:10:42] Starting 'createOutputDirs'...
[15:10:42] Finished 'createOutputDirs' after 18 ms
[15:10:42] Starting 'copyJs'...
[15:10:42] Finished 'copyJs' after 18 ms
[15:10:42] Starting 'copyBinaries'...
[15:10:42] Finished 'copyBinaries' after 2.01 ms
[15:10:42] Starting 'build:shared'...
[15:10:42] Starting 'cleanShared'...
[15:10:42] Finished 'cleanShared' after 1.19 ms
[15:10:42] Starting 'sharedBuild'...
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ cross-env NODE_ENV=production node ./webpack.config.js --compile --nomap
[15:10:50] Shared    9 modules
[15:10:51] Finished 'sharedBuild' after 8.48 s
[15:10:51] Finished 'build:shared' after 8.48 s
[15:10:51] Starting 'initStudio'...
[15:10:51] Finished 'initStudio' after 797 ms
[15:10:51] Starting 'buildModuleBuilder'...
[1/4] Resolving packages...
success Already up-to-date.
$ ./node_modules/.bin/babel src --out-dir bin --extensions ".ts,.js"
Successfully compiled 6 files with Babel.

[15:10:54] Finished 'buildModuleBuilder' after 2.22 s
[15:10:54] Starting 'cleanSdk'...
[15:10:54] Finished 'cleanSdk' after 4.2 ms
[15:10:54] Starting 'build-module analytics'...
[15:11:03] Finished 'build-module analytics' after 9.41 s
[15:11:03] Starting 'build-module basic-skills'...
[15:11:17] Finished 'build-module basic-skills' after 14 s
[15:11:17] Starting 'build-module builtin'...
[15:11:23] Finished 'build-module builtin' after 6.01 s
[15:11:23] Starting 'build-module channel-messenger'...
[15:11:30] Finished 'build-module channel-messenger' after 6.95 s
[15:11:30] Starting 'build-module channel-slack'...
[15:11:37] Finished 'build-module channel-slack' after 7.19 s
[15:11:37] Starting 'build-module channel-smooch'...
[15:11:44] Finished 'build-module channel-smooch' after 6.79 s
[15:11:44] Starting 'build-module channel-teams'...
[15:11:51] Finished 'build-module channel-teams' after 7.18 s
[15:11:51] Starting 'build-module channel-telegram'...
[15:11:58] Finished 'build-module channel-telegram' after 7.04 s
[15:11:58] Starting 'build-module channel-web'...
[15:12:16] Finished 'build-module channel-web' after 18 s
[15:12:16] Starting 'build-module code-editor'...
[15:12:37] Finished 'build-module code-editor' after 21 s
[15:12:37] Starting 'build-module examples'...
[15:12:45] Finished 'build-module examples' after 7.97 s
[15:12:45] Starting 'build-module extensions'...
[15:12:57] Finished 'build-module extensions' after 12 s
[15:12:57] Starting 'build-module hitl'...
[15:13:08] Finished 'build-module hitl' after 11 s
[15:13:08] Starting 'build-module misunderstood'...
[15:13:19] Finished 'build-module misunderstood' after 11 s
[15:13:19] Starting 'build-module nlu-extras'...
[15:13:27] Finished 'build-module nlu-extras' after 8.44 s
[15:13:27] Starting 'build-module nlu-testing'...
[15:13:36] Finished 'build-module nlu-testing' after 9.15 s
[15:13:36] Starting 'build-module nlu'...
[15:13:52] Finished 'build-module nlu' after 16 s
[15:13:52] Starting 'build-module qna'...
[15:14:06] Finished 'build-module qna' after 13 s
[15:14:06] Starting 'build-module testing'...
[15:14:31] Finished 'build-module testing' after 14 s
[15:14:31] Starting 'build-module uipath'...
[15:14:47] Finished 'build-module uipath' after 16 s
[15:14:47] Starting 'build:studio'...
[15:14:47] Starting 'buildStudio'...
clean-webpack-plugin: /Users/aungpyaekyaw/Data/Projects/3party/botpress/botpress/bp-source/botpress/src/bp/ui-studio/public has been removed.
[hardsource:224e7948] Using 74 MB of disk space.
[hardsource:224e7948] Tracking node dependencies with: yarn.lock.
[hardsource:224e7948] Reading from cache 224e7948...
[15:14:57] Finished 'buildStudio' after 10 s
[15:14:57] Starting 'cleanStudio'...
[15:14:57] Finished 'cleanStudio' after 43 ms
[15:14:57] Starting 'cleanStudioAssets'...
[15:14:57] Finished 'cleanStudioAssets' after 57 ms
[15:14:57] Starting 'copyStudio'...
[15:14:58] Finished 'copyStudio' after 627 ms
[15:14:58] Finished 'build:studio' after 11 s
[15:14:58] Starting 'build:admin'...
[15:14:58] Starting 'buildAdmin'...
warning " > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
warning " > bootstrap@4.3.1" has unmet peer dependency "popper.js@^1.14.7".
warning " > react-table@6.11.5" has unmet peer dependency "prop-types@^15.7.0".
warning " > expose-loader@0.7.5" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
warning " > hard-source-webpack-plugin@0.13.1" has unmet peer dependency "webpack@*".
Wrote 1 CSS files to /Users/aungpyaekyaw/Data/Projects/3party/botpress/botpress/bp-source/botpress/src/bp/ui-admin/src/
The following changes are being made to your tsconfig.json file:
  - compilerOptions.baseUrl must not be set (absolute imports are not supported (yet))
  - compilerOptions.paths must not be set (aliased imports are not supported)

[hardsource:b5b8fca6] Writing new cache b5b8fca6...
[hardsource:b5b8fca6] Tracking node dependencies with: yarn.lock.
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
[15:58:16] Finished 'buildAdmin' after 4.02 min
[15:58:16] Starting 'copyAdmin'...
[15:58:16] Finished 'copyAdmin' after 104 ms
[15:58:16] Finished 'build:admin' after 4.03 min
[15:58:16] Finished 'build' after 8.28 min
✨  Done in 2870.62s.
➜  botpress git:(master) cd modules/channel-messenger 
➜  channel-messenger git:(master) yarn package --linux
yarn run v1.19.2
$ node ../../build/module-builder/bin/entry package --linux
[module-builder] Error packaging module: Command failed: yarn install --modules-folder node_production_modules --production --no-lockfile --ignore-scripts --force
env: node: No such file or directory
 yarn install --modules-folder node_production_modules --production --no-lockfile --ignore-scripts --force env: node: No such file or directory

✨  Done in 2.45s.

@Aung_Pyae_Kyaw

The build doesn’t seem to see node!

Have you installed it? What is the output of node -v ?

@asashour. I’m using node version 10.11 with nvm. here is the output.

botpress git:(master) cd modules/channel-messenger 
➜  channel-messenger git:(master) yarn package --linux
yarn run v1.19.2
$ node ../../build/module-builder/bin/entry package --linux
[module-builder] Error packaging module: Command failed: yarn install --modules-folder node_production_modules --production --no-lockfile --ignore-scripts --force
env: node: No such file or directory
 yarn install --modules-folder node_production_modules --production --no-lockfile --ignore-scripts --force env: node: No such file or directory

✨  Done in 2.45s.
➜  channel-messenger git:(master) node -v                     
v10.11.0
➜  channel-messenger git:(master)

After looking into some gulp files I found that there is a separate option for mac os. do I have to run yarn package without --linux option because I’m running on the mac os? Sorry I forget to mention about my os. is there anything to do with mac os?

Well, it seems it is the default, so try yarn package.

Otherwise, please specify which version you use, for others to help.

@Aung_Pyae_Kyaw Here are the commands we use to package the mac executable:

export npm_config_target_platform=darwin
yarn --force --ignore-engines
yarn run build --mac --prod
yarn run package --mac