Build Failing from Source


#1

Hi guys - I am new to botpress. I am trying to build botpress from source.
As a pre-requisite I installed latest Nodejs and also Yarn on Windows 10.

then I I cloned the git repo from here on my local drive to \botpress:

After that I went inside the \botpress folder and I am trying to follow the steps mentioned below in the Quickstart on Github:
yarn
yarn build
yarn start

When I run Step 1 - yarn, i see below output on my cmd console:
yarn install v1.5.1
[1/5] Validating package.json…
[2/5] Resolving packages…
[3/5] Fetching packages…
[################################################################################################################################################] 1129/1130

It looks to me that it might not have worked properly as I am only able to see 3/5 and not 5/5.
Can someone confirm this please ?

Also after this when I try to run yarn build, i see below error -
yarn run v1.5.1
yarn cmd build yarn run gulp build
error An unexpected error occurred: “Command “gulp” not found.”.
info If you think this is a bug, please open a bug report with the information provided in “C:\SelfLearning\Botpress\github\botpress\yarn-error.log”.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: C:\WINDOWS\system32\cmd.exe
Arguments: /d /s /c yarn run gulp build
Directory: C:\SelfLearning\Botpress\github\botpress
Output:
".
info If you think this is a bug, please open a bug report with the information provided in “C:\SelfLearning\Botpress\github\botpress\yarn-error.log”.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: C:\WINDOWS\system32\cmd.exe
Arguments: /d /s /c yarn cmd build
Directory: C:\SelfLearning\Botpress\github\botpress

Can someone provide any clue how can i progress with the build.

thanks in advance !


#2

You should run yarn start not yarn run gulp build to start your bot by default.


#3

hi alex, thanks for your response.
i was not trying to start the bot.
i was trying to build from the source and following the Quickstart steps as documented on the github page.

however i suspect the issue was due to firewall settings on my office laptop.
when i ran the steps from my home, everything went fine and i was able to build botpress from source.


#4

Hm… That’s a weird command. Did you find it at https://botpress.io/docs/quickstart/ ?
Could you send a link to that page?


#5

Hi @akex. No that command was not there in the documentation. I had Ines the git repo and was trying to build from the source by following commands mentioned in the quick start as follows -

  1. yarn
  2. yarn build
  3. yarn start

But as I probably has issue in first command and jt looks like it didn’t ended successfully (although it explicitly gave any error), when I ran the “yarn build” command it faiked with that error.

But as I said I don’t have that issue anymore, I was able to successfully clone the repo and build and run Botoress.


#6

I started failing issues again when I am trying to build from source. I have tried to build with branch 11.0.0, 11.0.1, 11.0.2, 11.0.3 and 11.0.4, master.
Also posted on the GitHub as an issue.

Any helo or suggestion would be great. Thanks .


#7

hi @alex - can you suggest something for fixing this? I am constantly facing this issue no matter which 11.x branch / tag or release i try to clone. Ia m not able to build from source.


#8

@newthings4learning, botpress 11.x isn’t stable yet so you may experience issues like this.

error An unexpected error occurred: “Command “gulp” not found.”.

It looks like you need to install gulp globally.


#9

i still continue to have the same error :frowning:(

C:\Botpress\botpress>rename yarn.lock yarn.lock.1

C:\Botpress\botpress>yarn cache clean
yarn cache v1.12.3
success Cleared cache.
Done in 0.07s.

C:\Botpress\botpress>yarn
yarn install v1.12.3
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning inversify@4.14.0: Re-Released as 5.0.1
warning joi > hoek@5.0.4: This version is no longer maintained. Please upgrade to the latest version.
warning socketio-jwt > xtend > object-keys@0.4.0:
warning gulp-run > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
warning jest > jest-cli > prompts > kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
warning pkg > pkg-fetch > request > hawk > boom@4.3.1: This version is no longer maintained. Please upgrade to the latest version.
[3/5] Fetching packages...
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > bluebird-global@1.0.1" has unmet peer dependency "bluebird@*".
warning " > babel-jest@23.6.0" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-0".
[5/5] Building fresh packages...
success Saved lockfile.
Done in 178.43s.

C:\Botpress\botpress>yarn build
yarn run v1.12.3
$ yarn cmd build
$ yarn run gulp build
$ C:\Botpress\botpress\node_modules\.bin\gulp build
[01:13:06] Using gulpfile C:\Botpress\botpress\gulpfile.js
[01:13:06] Starting 'build'...
[01:13:06] Starting 'maybeFetchPro'...
[01:13:06] Finished 'maybeFetchPro' after 14 ms
[01:13:06] Starting 'writeMetadata'...
[01:13:06] Finished 'writeMetadata' after 14 ms
[01:13:06] Starting 'compileTypescript'...
src\bp\index.ts(29,36): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[string, (string | undefined)?, (Function | undefined)?]'.
  Type 'IArguments' is missing the following properties from type '[string, (string | undefined)?, (Function | undefined)?]': 0, pop, push, concat, and 25 more.
src\bp\sdk\rewire.ts(51,38): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[string]'.
  Type 'IArguments' is missing the following properties from type '[string]': 0, pop, push, concat, and 25 more.
TypeScript: 2 semantic errors
TypeScript: emit succeeded (with errors)
[01:13:12] 'compileTypescript' errored after 5.68 s
[01:13:12] Error: TypeScript: Compilation failed
    at Output.mightFinish (C:\Botpress\botpress\node_modules\gulp-typescript\release\output.js:130:43)
    at applySourceMap.then.appliedSourceMap (C:\Botpress\botpress\node_modules\gulp-typescript\release\output.js:65:22)
[01:13:12] 'build' errored after 5.73 s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.