MineDojo/Voyager

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

astroseger opened this issue · 5 comments

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

Install the stable version of node.js.

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

@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

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

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?