Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.5k views
in Technique[技术] by (71.8m points)

docker报错:The command '/bin/sh -c npm install' returned a ...

之前都是好好的,现在不管怎么构建,都是报这个错,求大佬支招

Step 1/10 : FROM node:latest
 ---> 2d840844f8e7
Step 2/10 : MAINTAINER YW
 ---> Using cache
 ---> 6631f9f14e00
Step 3/10 : RUN rm -rf /home/projects/tlt/web
 ---> Using cache
 ---> 60a540cb51ee
Step 4/10 : RUN mkdir -p /home/projects/tlt/web
 ---> Using cache
 ---> 68c0b5da1ed5
Step 5/10 : WORKDIR /home/projects/tlt/web
 ---> Using cache
 ---> 9303483f3de8
Step 6/10 : COPY . /home/projects/tlt/web
 ---> Using cache
 ---> 16261f0a871d
Step 7/10 : RUN npm install
 ---> Running in 8f26bddc17d6
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: tlt@0.0.1
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.6.0" from next@9.5.5
npm ERR! node_modules/next
npm ERR!   next@"^9.5.5" 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/2020-11-26T06_58_35_880Z-debug.log
ERROR: Service 'web' failed to build : The command '/bin/sh -c npm install' returned a non-zero code: 1

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

你可以参考下这个问题的回答https://ostack.cn/q/10...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...