I'm facing an error while hosting my discord bot on repl.it
I get this error,
/home/runner/JU-Bot/node_modules/discord.js/src/rest/RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^
SyntaxError: Unexpected token '?'
It works perfectly fine on my local machine.
That ?? is the nullish coalescing operator. Your error means you're running a version of node.js that does not support it. You'll want to upgrade to at least node version 14 to access this feature. Unfortunately, repl.it does not support upgrading to a newer version unless there is already a version for it when creating the repo.
To use the latest version of the DiscordJS library you will actually need Node v16+.
I tried to run a server application instance on Vercel that used DiscordJS but it uses Node version 14.x runtime. This ended up as an error and you need to use/host your server in an environment that is Node version 16.x+.
Related
I use Strapi and Nextjs. When trying to fetch Data threw the Rest api i´m getting the Error (see Screenshot)The Rest API is working and the URL for the fetch is correct as well...
Operating System: Mac OS
Strapi: 4.5.3
Node: 18.12.1
Next: 13.0.6
I had the same issue yesterday and it drove me crazy. I finally fixed it by reverting to older versions of Strapi and Node. Try this:
Install a version manager tool like asdf or nvm
In your project directory, set Node version to v16.19.0
Re-install Strapi using npx create-strapi-app#4.3.8 my-project --quickstart in the terminal (Strapi version 4.3.8)
This solved my issue. Hopefully it works for you too. This Strapi page has some version info that also might be helpful. I used it to determine what versions to revert to:
https://docs.strapi.io/developer-docs/latest/getting-started/quick-start.html#_1-install-strapi-and-create-a-new-project
I'm trying to do a fresh install of nextjs on Windows (see command line screenshot) using gitbash and latest nodejs lts version (16.14.2). When running npm run dev everything seems to be in order.
However, after browsing to http://localhost:3000, I receive this:
I looked at Fresh NextJS App throwing errors before any changes but the version in that issue is next 11.1.1 whereas current is 12.1.4. At this point I'm pretty much stuck. =\
Turns out it was an issue with Chrome extensions. I disabled all of them and no longer received the error. One by one I re-enabled all of them but never found the source. =\
Facing issue " Failed to install the app. Make sure you have the Android development environment " in react native
I have facing an android development error who should I resolve it . I used npx react-native init project name and then I ran react-native run-android I have always seen an error of android development server
It's a common pitfall for beginner. The error
Failed to install the app. Make sure you have the Android development environment ...
is misleading.
The real error is in the line
What went wrong: The suppplied javaHome seems to be invalid
which suggest that you should check the value of your env variable JAVA_HOME and make sure it points to a valid Java installation directory.
And if you have checked it and cannot figure out the problem, you may find it useful to check this question (IntelliJ Gradle Plugin: The supplied javaHome seems to be invalid) out. For example, someone suggest that its possible root cause is the incompatible version (32/64 bit) of your JDK.
Working on a web app using react.js that I picked up from another developer. Currently, trying to use AWS Amplify and I will eventually use AWS Cognito for authentication purposes.
I am using the following tutorial: https://hackernoon.com/react-authentication-in-depth-4deebda9aa45
I've already executed the following commands:
$ npm i -g #aws-amplify/cli
$ amplify configure
I've set up my CLI with the amplify config command, to include setting up the environment, access key ID and Secret Access key.
Error comes after running
$ amplify init
I've already seen a stack overflow post that states that this is a known error for the CLI, and that a fix has been implemented in the latest version of the CLI. I've tried updating amplify and re-installing. This is my second attempt to reinstall.
Here is a copy of the error in terminal.
MacBook-Air% amplify init
Note: It is recommended to run this command from the root of your app directory
? Do you want to use an existing environment? Yes
? Choose the environment you would like to use: discrete
Using default provider awscloudformation
✖ There was an error initializing your environment.
init failed
{ AccessDenied: Access Denied
at Request.extractError (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/services/s3.js:585:35)
at Request.callListeners (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/usr/local/lib/node_modules/#aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
message: 'Access Denied',
code: 'AccessDenied',
region: null,
time: 2019-05-01T18:09:17.901Z,
requestId: '7814262360A7DF07',
extendedRequestId:
'Y1woT4qs3VOtSCQG7sWNu7zexB2O+ZNP3oiBugTdfkHbK4Um5vzOS05P5qsZRcRFUPVTAbey8Q0=',
cfId: undefined,
statusCode: 403,
retryable: false,
retryDelay: 155.200421877319 }
Expect environment to properly initialize and amplify to be properly configured.
In my case, I cloned a repo from codecommit and doing amplify init and facing the same problem. To solve this, I rename aws-export.js to aws-export.mjs and again run amplify init and it initialize the project without any error.
You can check those issues reported at github project.
We had a similar issue using '#aws-amplify/cli' is version: '2.0.0', at aws Amplify Console.
Our envs develop, PR, etc. were building fine but master did not.
So, we change the version from 2.0.0 to 4.0.0 and build start working again.
Check
Console broken again (probably related to aws-amplify/cli 2.0.0)
AccessDenied error when deploying backend
It looks like the git repo has already teamproviderinfo.json present or some environment setting checking conflicting with your current setting. So when you try to init the project with environment name 'dev' or the one with the copied repo from git, it is trying to reuse the existing resources.
Solution: Try using a different name for the environment instead of dev and see if that works.
In my case it solved such issue.
Just installed Google Cloud SDK and whenever I try to run the gcloud command, it gives me this error:
\Google\google_appengine was unexpected at this time.
I have tried googling for this error but I haven't found anything. Any idea what I can do to fix this?
I am using Windows 8.1 and just installed Google Cloud SDK.
This is an already known issue which is occurring often. This happens when it updates to Cloud SDK version 274.0.0 in Windows. You may find more information here.
There is a workaround provided in this Stackoverflow post
I don't know if this question really had the same issue as a recent install, but the problem, or rather bug within the installer, is that you are using a directory that contains spaces within it. At some point of the script the space causes the command to be split up incorrectly, causing the error.
I had the same message and fixed it by re-installing the Google Cloud SDK in a directory without spaces (c:\Google\CloudSDK)