node.js - npm 错误!结束后写。在 docker、aws 中运行 npm 安装失败
问题描述
尝试跑步时,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"]
解决方案
推荐阅读
- python - 将 Python HTTP 请求转换为 curl
- python - 尝试下标时出现不可下标错误
- python - 基于 Python 的按名称查找对象的方法
- c++ - 在 C++ 中创建动态数据类型
- python - 我可以使用 python 看门狗来触发另一个文件执行吗
- c++ - 哪些 VertexList 类型对 depth_first_search 有效
- excel - excel中具有多个条件的依赖单元格值
- python - 如何真正分享上传到 Google Colab 的 Jupyter notebook?
- laravel - 如何在Octobercms的前端显示attachMany图像?
- html - 如何将地理位置添加到我的网络应用程序