Mic*_*ael 8 node.js npm docker
我是编码新手,所以请放轻松。
我在 github 上有一个由 softwarehouse 制作的项目 - 它是用 Django Rest 框架、React 应用程序、Docker 制作的应用程序的 MVP。
现在我想在我的 mac 上运行它,但有一个问题。
当我运行 docker-compose.yml 时,我从 docker-compose up 开始,它正在安装所有包,直到它进入尝试安装 npm 的步骤,并且出现错误:
npm notice
npm notice New patch version of npm available! 7.4.0 -> 7.4.3
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.4.3>
npm notice Run `npm install -g npm@7.4.3` to update!
npm notice
ERROR: Service 'pet-frontend' failed to build : The command '/bin/sh -c npm install --silent' returned a non-zero code: 1
Failed to deploy 'Compose: docker-compose.yml': `docker-compose` process finished with exit code 1
Run Code Online (Sandbox Code Playgroud)
不知道为什么我无法安装最新版本?我有最新的node.js,其中npm 是7.4.0。我如何强制安装 7.4.0 或如何安装 7.4.0?那么部署可以更进一步吗?
__ 更多信息 __
前端 dockerfile 如下所示:
FROM node:latest
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
RUN npm install --silent
RUN npm install react-scripts@3.4.1 -g --silent
COPY . ./
CMD ["npm", "start"]
Run Code Online (Sandbox Code Playgroud)
当我添加“RUN npm install -g npm@7.4.3”时 - 仍然出现相同的错误
当我在没有 --silent 的情况下运行 npm 时,出现此错误:
npm notice
npm notice New patch version of npm available! 7.4.0 -> 7.4.3
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.4.3>
npm notice Run `npm install -g npm@7.4.3` to update!
npm notice
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: prop-types@15.6.0
npm ERR! node_modules/prop-types
npm ERR! peer prop-types@"<=15.6.0" from check-prop-types@1.1.2
npm ERR! node_modules/check-prop-types
npm ERR! dev check-prop-types@"^1.1.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! react-leaflet-search@"^2.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: prop-types@15.7.2
npm ERR! node_modules/prop-types
npm ERR! peer prop-types@"^15.7.2" from react-leaflet-search@2.0.1
npm ERR! node_modules/react-leaflet-search
npm ERR! react-leaflet-search@"^2.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-01-26T10_49_01_333Z-debug.log
ERROR: Service 'petsy-frontend' failed to build : The command '/bin/sh -c npm install' returned a non-zero code: 1
Failed to deploy 'Compose: docker-compose.yml': `docker-compose` process finished with exit code 1
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18326 次 |
| 最近记录: |