botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
78 stars 87 forks source link

[Error] Building from source #1614

Closed bakrianoo closed 2 years ago

bakrianoo commented 2 years ago

Describe the bug I had a problem in building the project from source

I followed these steps for building

sudo wget https://github.com/botpress/botpress/archive/refs/tags/v12.26.10.zip
sudo unzip v12.26.10.zip

sudo npm install -g yarn

cd botpress-12.26.10
sudo rm yarn.lock
sudo yarn cache clean
sudo yarn
sudo yarn build

I used these versions

nodejs = 12.18.1
npm = 6.14.5
yarn = 1.22.10
OS = Ubuntu 20.04.3 LTS

The complete log of error

$ yarn cmd build
$ yarn run gulp build
$ /home/ubuntu/botpress-12.26.10/node_modules/.bin/gulp build
[18:21:33] Using gulpfile /home/ubuntu/botpress-12.26.10/gulpfile.js
[18:21:33] Starting 'build'...
[18:21:33] Starting 'build:sharedLite'...
[18:21:33] Starting 'sharedLiteBuild'...
warning package.json: No license field
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
[18:21:35] Finished 'sharedLiteBuild' after 1.67 s
[18:21:35] Finished 'build:sharedLite' after 1.67 s
[18:21:35] Starting 'clearMigrations'...
[18:21:35] Finished 'clearMigrations' after 12 ms
[18:21:35] Starting 'maybeFetchPro'...
[18:21:35] Finished 'maybeFetchPro' after 7.06 ms
[18:21:35] Starting 'writeMetadata'...
Couldn't get active branch OperationalError: Command failed: git rev-parse --abbrev-ref HEAD
fatal: not a git repository (or any of the parent directories): .git

    at ChildProcess.exithandler (child_process.js:303:12)
    at ChildProcess.emit (events.js:315:20)
    at ChildProcess.EventEmitter.emit (domain.js:505:15)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
  cause: Error: Command failed: git rev-parse --abbrev-ref HEAD
  fatal: not a git repository (or any of the parent directories): .git

      at ChildProcess.exithandler (child_process.js:303:12)
      at ChildProcess.emit (events.js:315:20)
      at ChildProcess.EventEmitter.emit (domain.js:505:15)
      at maybeClose (internal/child_process.js:1021:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
    killed: false,
    code: 128,
    signal: null,
    cmd: 'git rev-parse --abbrev-ref HEAD'
  },
  isOperational: true,
  killed: false,
  code: 128,
  signal: null,
  cmd: 'git rev-parse --abbrev-ref HEAD'
}
[18:21:35] Finished 'writeMetadata' after 21 ms
[18:21:35] Starting 'compileTypescript'...
packages/bp/src/admin/management/modules/modules-router.ts(24,22): error TS2532: Object is possibly 'undefined'.
packages/bp/src/admin/workspace/collaborators/collaborators-router.ts(26,64): error TS2339: Property 'split' does not exist on type 'string | string[] | ParsedQs | ParsedQs[]'.
  Property 'split' does not exist on type 'string[]'.
packages/bp/src/admin/workspace/collaborators/collaborators-router.ts(43,46): error TS2339: Property 'split' does not exist on type 'string | string[] | ParsedQs | ParsedQs[]'.
  Property 'split' does not exist on type 'string[]'.
packages/bp/src/admin/workspace/logs/logs-router.ts(20,64): error TS2345: Argument of type 'string | string[] | ParsedQs | ParsedQs[] | undefined' is not assignable to parameter of type 'number | undefined'.
  Type 'string' is not assignable to type 'number'.
packages/bp/src/admin/workspace/logs/logs-router.ts(54,38): error TS2345: Argument of type 'string | string[] | ParsedQs | ParsedQs[]' is not assignable to parameter of type 'string'.
  Type 'string[]' is not assignable to type 'string'.
packages/bp/src/admin/workspace/logs/logs-router.ts(55,36): error TS2345: Argument of type 'string | string[] | ParsedQs | ParsedQs[]' is not assignable to parameter of type 'string'.
packages/bp/src/admin/workspace/workspaces/workspaces-router.ts(147,42): error TS2345: Argument of type 'string' is not assignable to parameter of type 'RolloutStrategy'.
packages/bp/src/admin/workspace/workspaces/workspaces-router.ts(151,73): error TS2322: Type 'string' is not assignable to type 'RolloutStrategy | undefined'.
packages/bp/src/core/config/config-loader.ts(11,13): error TS2305: Module '"lodash"' has no exported member 'PartialDeep'.
packages/bp/src/core/converse/converse-router.ts(59,30): error TS2339: Property 'toLowerCase' does not exist on type 'string | string[] | ParsedQs | ParsedQs[]'.
  Property 'toLowerCase' does not exist on type 'string[]'.
packages/bp/src/core/converse/converse-router.ts(70,64): error TS2345: Argument of type 'string | string[] | ParsedQs | ParsedQs[] | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
packages/bp/src/core/converse/converse-router.ts(95,64): error TS2345: Argument of type 'string | string[] | ParsedQs | ParsedQs[] | undefined' is not assignable to parameter of type 'string'.
packages/bp/src/core/media/media-router.ts(85,65): error TS2532: Object is possibly 'undefined'.
packages/bp/src/core/media/media-router.ts(85,84): error TS2532: Object is possibly 'undefined'.
packages/bp/src/core/modules/modules-router.ts(61,53): error TS2322: Type 'string | string[] | ParsedQs | ParsedQs[] | undefined' is not assignable to type 'string'.
packages/bp/src/core/qna/qna-router.ts(55,11): error TS2322: Type 'string | string[] | ParsedQs | ParsedQs[]' is not assignable to type 'string | undefined'.
  Type 'string[]' is not assignable to type 'string'.
packages/bp/src/core/qna/qna-router.ts(56,11): error TS2322: Type 'string | string[] | ParsedQs | ParsedQs[]' is not assignable to type 'never[] | undefined'.
  Type 'string' is not assignable to type 'never[]'.
packages/bp/src/core/routers/util.ts(144,18): error TS2430: Interface 'TypedResponse<T>' incorrectly extends interface 'Response<any, Record<string, any>>'.
  The types returned by 'send(...)' are incompatible between these types.
    Type 'TypedResponse<T>' is not assignable to type 'this'.
      'TypedResponse<T>' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'TypedResponse<T>'.
TypeScript: 18 semantic errors
TypeScript: emit succeeded (with errors)
[18:21:59] 'compileTypescript' errored after 24 s
[18:21:59] Error: TypeScript: Compilation failed
    at Output.mightFinish (/home/ubuntu/botpress-12.26.10/node_modules/gulp-typescript/release/output.js:131:43)
    at /home/ubuntu/botpress-12.26.10/node_modules/gulp-typescript/release/output.js:66:22
    at bound (domain.js:426:14)
    at runBound (domain.js:439:12)
    at tryCatcher (/home/ubuntu/botpress-12.26.10/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/ubuntu/botpress-12.26.10/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/ubuntu/botpress-12.26.10/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/ubuntu/botpress-12.26.10/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/ubuntu/botpress-12.26.10/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/home/ubuntu/botpress-12.26.10/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/home/ubuntu/botpress-12.26.10/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/home/ubuntu/botpress-12.26.10/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/ubuntu/botpress-12.26.10/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:456:21)
    at process.topLevelDomainCallback (domain.js:137:15)
[18:21:59] 'build' errored after 26 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.

Any help ?