Ask coding questions

← Back to all posts
WHY AM I GETTING THIS ERROR AND HOW CAN I SOLVE IT
Dashdaber154

/home/runner/100/node_modules/reconlx/node_modules/discord.js/src/rest/APIRequest.js:33
agent ??= new https.Agent({ ...this.client.options.http.agent, keepAlive: true });
^^^

SyntaxError: Unexpected token '??='
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/home/runner/100/node_modules/reconlx/node_modules/discord.js/src/rest/RESTManager.js:4:20)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/home/runner/100/node_modules/reconlx/node_modules/discord.js/src/client/BaseClient.js:4:21)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
exit status 1

Voters
Dashdaber154
Comments
hotnewtop
SixBeeps

The ??= token was added in NoveJS v16. If you can, migrate over to a NodeJS 16 Repl for it to work.

Dashdaber154

how to do that i am newbie
@SixBeeps

snowspy1

@Dashdaber154

run this in the shell

npm init -y && npm i --save-dev [email protected] && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH