OpenCTI-Platform / opencti

Open Cyber Threat Intelligence Platform
https://opencti.io
Other
6.51k stars 959 forks source link

SyntaxError: Unexpected Token '?' Error during installation #3000

Open MrVenomous1 opened 1 year ago

MrVenomous1 commented 1 year ago

Description

I'm trying to conduct a fresh install of OpenCTI. I have been getting an error regarding an unexpected token when performing the yarn build. It seems to beresulting from the node_modules/graphhql-request/build/cjs/index.js file.

Environment

  1. OS (where OpenCTI server runs): Ubuntu 22.04
  2. OpenCTI version: OpenCTI 5.6.1
  3. OpenCTI client: python
  4. Other environment details: All dependencies (NodeJs, Python, ElasticSearch, MinIO, Redis, RabbitMQ) are installed and working. I'm conducting a manual installation from opencti-release-5.6.1.tar.gz. As stated dependencies are functional. I copied and entered the variables in the config/production.json. The python requirements have been installed.

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Run the command yarn install
  2. Run the command yarn build
  3. SyntaxError: Unexpected token '?'

Expected Output

Working correctly

Actual Output

`home/xxxxx/cti/opencti/node_modules/graphql-request/build/cjs/index.js:112 jsonSerializer: fetchOptions.jsonSerializer ?? defaultJsonSerializer_js_1.defaultJsonSerializer, ^

SyntaxError: Unexpected token '?' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/home/xxxxx/cti/opencti/node_modules/@graphql-tools/prisma-loader/cjs/prisma-yml/Cluster.js:8:27) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) `

Additional information

Screenshots (optional)

image

image

MrVenomous1 commented 1 year ago

When conducting the install OpenCTI 5.6.1 on an Ubuntu 20.04, I get an entirely different error:

`internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'worker_threads' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at /root/opencti/.yarn/releases/yarn-3.2.0.cjs:427:2642 at Object. (/root/opencti/.yarn/releases/yarn-3.2.0.cjs:740:8778) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) `

richard-julien commented 1 year ago

Can you check if you have the latest version of nodejs installed?