Unexpected Token & Node Node Version issues
I am trying to install discord-api-types on my Raspberry Pi arm7 Node Version 14.21.3 (needed for written code) npm v10.2.3. Below is the code I am getting and I have tried to trouble shoot this on my own and am struggling. I am self taught, and barely grasp python. Can anyone help I need the node to stay the same but IDK how to get it to install.
nora@raspberrypi:~ $ npm install discord-api-types
ERROR: npm v10.2.3 is known not to run on Node.js v14.21.3. This version of npm supports the following node versions:
^18.17.0 || >=20.5.0
. You can find the latest version at https://nodejs.org/.
ERROR:
/home/nora/.config/nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/@npmcli/agent/lib/agents.js:105
options.lookup ??= this.#options.lookup
^^^
SyntaxError: Unexpected token '??='
at wrapSafe (internal/modules/cjs/loader.js:1029:16)
at Module._compile (internal/modules/cjs/loader.js:1078:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:979:32)
at Function.Module._load (internal/modules/cjs/loader.js:819:12)
at Module.require (internal/modules/cjs/loader.js:1003:19)
at require (internal/modules/cjs/helpers.js:107:18)
at Object.<anonymous> (/home/nora/.config/nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/@npmcli/agent/lib/index.js:7:15)
at Module._compile (internal/modules/cjs/loader.js:1114:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)7 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPNode v14 is much too old
I'm not sure how you ended up with a much newer npm version without updating node
I cant change it due to the bot code on github is my issue
Not sure I understand - why can't you update Node on your own Raspberry Pi?
What does that have to do with your GitHub code
discord.js doesn't support that version of Node either so
When I updated it last time and tried it another way it kept throwing error codes for reading the github file as it was saying it was new than 14. So I had to back track the node before it read
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
This really isn't a discord.js related issue. Generally speaking, newer versions of Node are backwards compatible
So whatever part of your code is complaining about a newer version is unlikely to be discord.js