MineDojo / Voyager

An Open-Ended Embodied Agent with Large Language Models
https://voyager.minedojo.org/
MIT License
5.36k stars 492 forks source link

`npm ERR! cb.apply is not a function` error during installation #98

Closed astroseger closed 1 year ago

astroseger commented 1 year ago

I got an error during installation in Node.js Install section at npx tsc line.

npm ERR! cb.apply is not a function

There is a Dockerfile to reproduce this error:

FROM ubuntu:latest
RUN apt-get update -y

# set tzdata
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get install -y git python3

RUN apt-get install -y python3-pip
RUN mkdir /app
WORKDIR /app
RUN git clone https://github.com/MineDojo/Voyager.git
WORKDIR /app/Voyager
RUN pip install -e .
WORKDIR /app/Voyager/voyager/env/mineflayer
RUN apt-get install npm -y
RUN npm install -g npx
RUN npm install
WORKDIR /app/Voyager/voyager/env/mineflayer/mineflayer-collectblock
RUN npx tsc
GoingMyWay commented 1 year ago

Install the stable version of node.js.

astroseger commented 1 year ago

@GoingMyWay which version would you recommend? I assume ubuntu have a stable version by default.

GoingMyWay commented 1 year ago

@GoingMyWay which version would you recommend? I assume ubuntu have a stable version by default.

I installed the left one on macOS. I think it also works for broader linux variants.

image

astroseger commented 1 year ago

solved with the following:

FROM ubuntu:latest
RUN apt-get update -y

# set tzdata
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get install -y git python3

RUN apt-get install -y python3-pip
RUN mkdir /app
WORKDIR /app
RUN git clone https://github.com/MineDojo/Voyager.git
WORKDIR /app/Voyager
RUN pip install -e .
WORKDIR /app/Voyager/voyager/env/mineflayer
RUN apt-get install curl -y
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install nodejs -y
RUN npm install -g npm@9.7.1
#RUN npm install -g npx
RUN npm install
WORKDIR /app/Voyager/voyager/env/mineflayer/mineflayer-collectblock
RUN apt-get install nodejs -y
RUN npx tsc
GoingMyWay commented 1 year ago

solved with the following:

FROM ubuntu:latest
RUN apt-get update -y

# set tzdata
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get install -y git python3

RUN apt-get install -y python3-pip
RUN mkdir /app
WORKDIR /app
RUN git clone https://github.com/MineDojo/Voyager.git
WORKDIR /app/Voyager
RUN pip install -e .
WORKDIR /app/Voyager/voyager/env/mineflayer
RUN apt-get install curl -y
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install nodejs -y
RUN npm install -g npm@9.7.1
#RUN npm install -g npx
RUN npm install
WORKDIR /app/Voyager/voyager/env/mineflayer/mineflayer-collectblock
RUN apt-get install nodejs -y
RUN npx tsc

@astroseger What is the key issue?

By the way, do you know how to run the code on the server without GUI?