错误:找不到模块“dotenv-expand”

时间:2021-07-05 19:21:43

标签: node.js macos docker npm dotenv

尝试在 MacBook M1 中设置这个 docker 容器,它正在配置后端和前端的依赖关系。后端建立良好,但在构建前端时出现了这个最终错误。

getting this error

我已经在 package.json 文件中检查并找到了 dotenv-expand 包,但我认为由于某些原因它没有安装它。

这是dockerfile

FROM node:10.14

RUN apt-get update && \
  apt-get install -y \
  libgtk2.0-0 \
  libnotify-dev \
  libgconf-2-4 \
  libnss3 \
  libxss1 \
  libasound2 \
  xvfb

RUN mkdir /app 

WORKDIR /app

# Allows docker to cache installed dependencies between builds
COPY ./package.json /app/package.json
COPY ./yarn.lock /app/yarn.lock


RUN npm install yarn && ./node_modules/.bin/yarn install
RUN npm install --save-dev uglifyjs-webpack-plugin@1
# Adds our application code to the image
COPY . /app


#RUN yarn postinstall

RUN npm i npm-run-all -D

EXPOSE 8000
EXPOSE 9001


# kicks off the server
CMD yarn start

我在 package.json 中找到的这些依赖

    "dotenv": "6.0.0",
    "dotenv-expand": "4.2.0",
    "dotenv-extended": "^2.9.0",

0 个答案:

没有答案
相关问题