[英]Can't install Next.js with Preact
我正在尝试从 vercel 安装 Next.js/Preact.js 设置,但出现以下错误:
> 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,但我遇到了同样的问题,我该如何解决这个问题?
我认为这是一个与 npx 相关的错误。 我正在使用yarn create next-app --example using-preact using-preact-app
并已成功安装,但不幸的是,该示例似乎无法正常工作并抛出错误Could not find module' webpack
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.