reworkd / AgentGPT

🤖 Assemble, configure, and deploy autonomous AI Agents in your browser.
https://agentgpt.reworkd.ai
GNU General Public License v3.0
31.94k stars 9.25k forks source link

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

Closed cmhac closed 1 year ago

cmhac commented 1 year ago

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

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?

Acknowledgements

cmhac commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Node.js Version Issue :warning:

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 :globe_with_meridians:

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:

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. :+1:

jasangill1 commented 1 year ago

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 commented 6 months ago

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!