gpt4 book ai didi

node.js - npm 错误!写在结束之后。 RUN npm install 在 docker、aws 中失败

转载 作者:太空宇宙 更新时间:2023-11-03 21:51:58 26 4
gpt4 key购买 nike

尝试运行 docker build -t app . --memory 3G --memory-swap 4G 时我遇到了

 Step 8/11 : RUN npm install
---> Running in 5283e1139345
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated tar.gz@1.0.7: ⚠️ WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm ERR! write after end

有谁知道这个错误是什么原因造成的?为什么 npm 没有安装?我将 aws 与 Docker 结合使用。

Dockerfile如下所示

FROM ubuntu:18.04

WORKDIR /app
COPY . .

# If you have native dependencies, you'll need extra tools
# RUN apk add --no-cache make gcc g++ python
RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-utils -y \
&& apt-get install curl -y \
&& apt-get install git-core -y \
&& curl -sL https://deb.nodesource.com/setup_8.x \
&& apt-get install -y nodejs npm \
&& curl https://cmake.org/files/v3.11/cmake-3.11.3-Linux-x86_64.sh -o /tmp/curl-install.sh \
&& chmod u+x /tmp/curl-install.sh \
&& mkdir /usr/bin/cmake \
&& /tmp/curl-install.sh --skip-license --prefix=/usr/bin/cmake \
&& rm /tmp/curl-install.sh \
&& apt-get install libpq-dev -y \
&& apt-get install libboost-all-dev -y \
&& apt-get install postgresql-server-dev-all -y

ENV PATH="/usr/bin/cmake/bin:${PATH}"

RUN npm install -g npm@5

RUN ./move-cpp-files.sh
RUN npm install
RUN npm run compile

EXPOSE 3000
CMD ["npm", "start"]

最佳答案

您可能正在安装 had this problem 的 NPM 版本:

运行 npm install -g npm@5

尝试不使用该行,或者是否有特定原因?

关于node.js - npm 错误!写在结束之后。 RUN npm install 在 docker、aws 中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51585455/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com