首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >生成失败的命令"npm安装“,退出1

生成失败的命令"npm安装“,退出1
EN

Stack Overflow用户
提问于 2022-09-12 18:23:38
回答 2查看 177关注 0票数 -1

因此,自从项目启动以来,部署从来没有问题,今天不知从哪里冒出来的这条消息开始出现在vercel上。

应用程序是使用下一个js编写的。

我找了又找,却找不到对我有用的解决办法.

代码语言:javascript
复制
Cloning github.com/ThiagoC0STA/kfk (Branch: main, Commit: f69b855)
Cloning completed: 1.077s
Looking up build cache...
Build Cache not found
Running "vercel build"
Vercel CLI 28.2.2
Installing dependencies...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: react-elastic-carousel@0.11.5
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR!   react@"18.2.0" from the root project
npm ERR!   peer react@"^17.0.2 || ^18.0.0-0" from next@12.2.5
npm ERR!   node_modules/next
npm ERR!     next@"12.2.5" from the root project
npm ERR!   5 more (react-dom, react-slick, styled-components, styled-jsx, use-sync-external-store)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"15 - 17" from react-elastic-carousel@0.11.5
npm ERR! node_modules/react-elastic-carousel
npm ERR!   react-elastic-carousel@"^0.11.5" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@17.0.2
npm ERR! node_modules/react
npm ERR!   peer react@"15 - 17" from react-elastic-carousel@0.11.5
npm ERR!   node_modules/react-elastic-carousel
npm ERR!     react-elastic-carousel@"^0.11.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 /vercel/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     /vercel/.npm/_logs/2022-09-12T18_11_25_601Z-debug-0.log
Error: Command "npm install" exited with 1

package.json

代码语言:javascript
复制
{
  "name": "kfk",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "12.2.5",
    "next-images": "^1.8.4",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-elastic-carousel": "^0.11.5",
    "react-slick": "^0.29.0",
    "slick-carousel": "^1.8.1",
    "styled-components": "^5.3.5"
  },
  "devDependencies": {
    "babel-plugin-styled-components": "^2.0.7",
    "eslint": "8.22.0",
    "eslint-config-next": "12.2.5"
  }
}

我不明白为什么我会突然出现这个错误,因为我已经部署了几个星期了,而且这个错误是从不知道的地方开始的。

EN

回答 2

Stack Overflow用户

发布于 2022-09-12 18:53:57

试着跑

代码语言:javascript
复制
npm install --legacy-peer-deps

票数 0
EN

Stack Overflow用户

发布于 2022-09-12 23:00:01

如果有必要的话,你可以试着用武力

npm安装-力

这是docs Npm安装-力

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73693694

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档