Home > Mobile >  npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-y"
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-y"

Time:02-13

Good morning, I was trying to install the following repository: https://github.com/AntoineMeler/Paraglidable I simply ran the following command:

docker build -t paraglidable Paraglidable/docker/.

I got the following error:

npm ERR! Linux 5.4.0-97-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-y" "--no-install-recommends" "--global" "mathjax-node-cli"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror     at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror     at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror     at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <http://github.com/npm/npm/issues>
npm WARN deprecated [email protected]: This package has been archived. MathJax v3 provides equivalent functionality.

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

I searched online for the following problem, I believe it is caused by a deprecated version of the mathjax module but I don't understand how I can correct the problem.

Docker is running on ubuntu server 20.04.

Could you be so kind as to help me? Thank you very much!

CodePudding user response:

The error seems to be related to the npm version used while installing the package mathjax-node-cli.

Installing a newer version of node.js will solve the issue, since it will also upgrade the npm version.

I've edited the Dockerfile as follows, and now it seems to be working.

FROM tensorflow/tensorflow:latest-py3

ARG USERNAME=paraglidable
RUN useradd -m $USERNAME
ENV HOME /home/$USERNAME

ENV DEBIAN_FRONTEND=noninteractive

## Added the line below for installing node.js version 12 instead of 8.
RUN curl -fsSL https://deb.nodesource.com/setup_12.x | bash -

## Also removed `npm` from here since it is already included in `nodejs` package
RUN apt-get -y update && apt-get install -y --no-install-recommends net-tools libopenjp2-7-dev libpng-dev libpng16-16 vim sass wget qt5-default pdf2svg apache2 php libapache2-mod-php nodejs ibgeos-3.6.2 libgeos-dev unzip

# grib
RUN apt-get -y update && apt-get install -y --no-install-recommends libgrib-api-dev libgrib-api0
RUN apt-get -y update && apt-get install -y --no-install-recommends libeccodes-dev libeccodes0

# tex2svg
RUN npm install -y --no-install-recommends --global mathjax-node-cli

# Add sudo support
RUN apt-get install -y sudo \
    && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \
    chmod 0440 /etc/sudoers.d/$USERNAME


USER $USERNAME

RUN sudo pip install glob3 tqdm colorama requests pandas matplotlib pillow numba pyproj jupyter
RUN sudo pip install pygrib
RUN sudo pip install https://github.com/matplotlib/basemap/archive/master.zip
  • Related