Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup.sh does not work with ubuntu 22.04 and node v18.16.0 #786

Closed
6 of 10 tasks
christopher-hacker opened this issue Jun 12, 2023 · 7 comments · May be fixed by #1551
Closed
6 of 10 tasks

Setup.sh does not work with ubuntu 22.04 and node v18.16.0 #786

christopher-hacker opened this issue Jun 12, 2023 · 7 comments · May be fixed by #1551
Labels
bug Something isn't working

Comments

@christopher-hacker
Copy link

Please check that this issue hasn't been reported before.

  • I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

When running ./setup.sh, the setup should run successfully

Current behaviour

When I run ./setup.sh, npm ci fails.

Steps to reproduce

  1. Clone the repo using git clone https://github.com/reworkd/AgentGPT.git && cd AgentGPT
  2. Run ./setup.sh

I am using Ubuntu 22.04.1 LTS, and my node version is v18.16.0

The output of build step 7/15: RUN npm ci is:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'agent-gpt@0.8.0',
npm WARN EBADENGINE   required: { node: '>=18.0.0 <19.0.0' },
npm WARN EBADENGINE   current: { node: 'v19.9.0', npm: '9.6.3' }
npm WARN EBADENGINE }

Possible solution

No response

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Acknowledgements

  • My issue title is concise, descriptive, and in title casing.
  • I have searched the existing issues to make sure this bug has not been reported yet.
  • I am using the latest version of AgentGPT.
  • I have provided enough information for the maintainers to reproduce and diagnose the issue.
@christopher-hacker christopher-hacker added the bug Something isn't working label Jun 12, 2023
@christopher-hacker
Copy link
Author

Updated error message from that step is:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'agent-gpt@0.8.0',
npm WARN EBADENGINE   required: { node: '>=18.0.0 <19.0.0' },
npm WARN EBADENGINE   current: { node: 'v19.9.0', npm: '9.6.3' }
npm WARN EBADENGINE }
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz failed, reason: connect ETIMEDOUT 2606:4700::6810:1523:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-06-12T21_03_52_226Z-debug-0.log
The command '/bin/sh -c npm ci' returned a non-zero code: 1

@JPDucky
Copy link
Contributor

JPDucky commented Jun 12, 2023

Try removing the <19.0.0 from your package.json and let me know if that works.

As for the lines

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz failed, reason: connect ETIMEDOUT 2606:4700::6810:1523:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

Those mean that something is incorrect with your network settings. I see that it tried to reach the endpoint via IPv6, do you have your network setup for that correctly?

@JPDucky
Copy link
Contributor

JPDucky commented Jun 12, 2023

Just pulled latest, and I've got it up and working, and I did get the same error but I just let it continue and it pulled the correct node version:

Step 6/15 : COPY package*.json ./
 ---> fd0646ce4b7d
Step 7/15 : RUN npm ci
 ---> Running in 6e2cd3158053
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'agent-gpt@0.8.0',
npm WARN EBADENGINE   required: { node: '>=18.0.0 <19.0.0' },
npm WARN EBADENGINE   current: { node: 'v19.9.0', npm: '9.6.3' }
npm WARN EBADENGINE }

> agent-gpt@0.8.0 postinstall
> prisma generate

I think your network configuration error is preventing you from pulling the correct version.

@gaborkukucska
Copy link

I thought I'll piggyback on this bug report as it seems to be related. I have also been unable to run the setup.sh on Ubuntu 22.04, Even after removing <19.0.0 from the package.json file.

I get this error by the setup script:

agentgpt-cli@1.0.0 start
node src/index.js

file:///home/ubuntu/AgentGPT/cli/node_modules/inquirer/lib/prompts/editor.js:78
postfix: this.opt.postfix ?? '.txt',
^

SyntaxError: Unexpected token '?'
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)

@jasangill1
Copy link
Collaborator

jasangill1 commented Jun 27, 2023

Node.js Version Issue ⚠️

The EBADENGINE warning is due to the current Node.js version (v19.9.0) being higher than what's specified in the package.json file (>=18.0.0 <19.0.0). This warning shouldn't prevent the setup script from running, but it might cause compatibility issues.

If you want to use Node.js v19.9.0, you can remove the <19.0.0 from the engine field in the package.json file. However, be aware that this might cause compatibility issues if the code relies on features or behaviors specific to Node.js v18.

Network Issue 🌐

The ETIMEDOUT error suggests a network connectivity issue. This could be caused by a variety of factors, such as a slow network connection, a firewall blocking connections, or a misconfigured proxy.

Here are a few things you can try:

  • If you're using a proxy, ensure it's configured correctly. You can check your npm proxy configuration by running npm config get proxy and npm config get https-proxy.
  • Try switching to a different network, if possible.
  • If you're using a VPN, try disconnecting from it.
  • If your network supports IPv6, ensure it's configured correctly.

Regarding the SyntaxError: Unexpected token '?', this error occurs when your version of Node.js does not support the optional chaining (?.) operator. It's likely that the installed Node.js version is older than the version that introduced this feature (Node.js v14.0.0).

You could update your Node.js to a newer version to resolve this issue. You can use a version management tool like nvm (Node Version Manager) to easily switch between different Node.js versions. Here's how you can install it:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

Once installed, you can install a new version of Node.js and use it:

nvm install 19
nvm use 19

I hope this helps! Please let me know if you have further questions or issues. 👍

@jasangill1
Copy link
Collaborator

Hello, @christopher-hacker Were you able to come and try these solutions out!!?? Please do and let me know if they worked for you, otherwise, I will be closing due to inactivity. If this problem still exists please feel free to reopen the ticket!!!

@antigenius0910
Copy link

Hi @christopher-hacker, @jasangill1

I think I have figure out the root cause. PR created here #1551. and hope more people will be able to enjoy this awesome project! thanks team!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants