首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用Preact安装Next.js

无法使用Preact安装Next.js
EN

Stack Overflow用户
提问于 2021-02-14 01:22:58
回答 1查看 201关注 0票数 1

我试图从vercel安装Next.js/Preact.js安装程序,但得到以下错误:

代码语言:javascript
复制
> npx create-next-app --example using-preact using-preact-app

Need to install the following packages:
  create-next-app
Ok to proceed? (y) y
Creating a new Next.js app in /home/somayyah/Documents/using-preact-app.

Downloading files for example using-preact. This might take a moment.

Installing packages. This might take a couple of minutes.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: using-preact@1.0.0
npm ERR! Found: react@0.0.3
npm ERR! node_modules/react
npm ERR!   react@"npm:@preact/compat@^0.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.6.0 || ^17" from next@10.0.6
npm ERR! node_modules/next
npm ERR!   next@"^10.0.0" 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 /home/somayyah/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/somayyah/.npm/_logs/2021-02-13T17_16_32_165Z-debug.log

我试着在另一个项目上自己设置Preact,但我遇到了同样的问题,我如何解决这个问题?

EN

回答 1

Stack Overflow用户

发布于 2021-02-14 07:02:45

我认为这是一个与npx相关的bug。我使用的是yarn create next-app --example using-preact using-preact-app,并且安装成功,但不幸的是,该示例看起来不起作用,并抛出错误Could not find module' webpack

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

https://stackoverflow.com/questions/66187879

复制
相关文章

相似问题

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