Reactjs 错误:命令";“npm运行-构建”;以1退出。vercel使用next.js部署错误

Reactjs 错误:命令";“npm运行-构建”;以1退出。vercel使用next.js部署错误,reactjs,npm,next.js,vercel,emotion,Reactjs,Npm,Next.js,Vercel,Emotion,我试图用vercel和git repository部署我的next.js网站。这是我从vercel deploy网站控制台收到的消息。 已尝试安装emonition/react,但仍不起作用 14:59:59.757 Cloning github.com/dor29494/my-app (Branch: test, Commit: 400d8a4) 15:00:00.829 Cloning completed: 1.072s 15:00:00.851 Analyzing

我试图用vercel和git repository部署我的next.js网站。这是我从vercel deploy网站控制台收到的消息。 已尝试安装emonition/react,但仍不起作用

   14:59:59.757     Cloning github.com/dor29494/my-app (Branch: test, Commit: 400d8a4)
15:00:00.829    Cloning completed: 1.072s
15:00:00.851    Analyzing source code...
15:00:01.658    Installing build runtime...
15:00:04.373    Build runtime installed: 2.715s
15:00:06.725    Build cache not provided
15:00:07.847    Installing dependencies...
15:00:08.325    npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
15:00:19.992    > core-js@3.6.5 postinstall /vercel/path0/node_modules/core-js
15:00:19.992    > node -e "try{require('./postinstall')}catch(e){}"
15:00:20.088    > protobufjs@6.10.2 postinstall /vercel/path0/node_modules/protobufjs
15:00:20.088    > node scripts/postinstall
15:00:20.443    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
15:00:20.443    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
15:00:20.445    added 539 packages from 364 contributors in 12.152s
15:00:20.626    31 packages are looking for funding
15:00:20.626      run `npm fund` for details
15:00:20.648    Detected Next.js version: 10.0.8
15:00:20.649    Running "npm run build"
15:00:20.861    > learn-starter@0.1.0 build /vercel/path0
15:00:20.861    > next build
15:00:21.906    info  - Creating an optimized production build...
15:00:21.922    Attention: Next.js now collects completely anonymous telemetry regarding usage.
15:00:21.922    This information is used to shape Next.js' roadmap and prioritize features.
15:00:21.922    You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
15:00:21.922    https://nextjs.org/telemetry
15:00:26.563    Failed to compile.
15:00:26.563    ModuleNotFoundError: Module not found: Error: Can't resolve '@emotion/styled' in '/vercel/path0/node_modules/@material-ui/core/node_modules/@material-ui/styled-engine'
15:00:26.563    > Build error occurred
15:00:26.564    Error: > Build failed because of webpack errors
15:00:26.564        at /vercel/path0/node_modules/next/dist/build/index.js:15:918
15:00:26.564        at runMicrotasks (<anonymous>)
15:00:26.564        at processTicksAndRejections (internal/process/task_queues.js:93:5)
15:00:26.564        at async /vercel/path0/node_modules/next/dist/build/tracer.js:3:470
15:00:26.578    npm ERR! code ELIFECYCLE
15:00:26.578    npm ERR! errno 1
15:00:26.581    npm ERR! learn-starter@0.1.0 build: `next build`
15:00:26.581    npm ERR! Exit status 1
15:00:26.581    npm ERR! 
15:00:26.581    npm ERR! Failed at the learn-starter@0.1.0 build script.
15:00:26.581    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
15:00:26.589    npm ERR! A complete log of this run can be found in:
15:00:26.589    npm ERR!     /vercel/.npm/_logs/2021-05-19T12_00_26_582Z-debug.log
15:00:26.601    Error: Command "npm run build" exited with 1
14:59:59.757克隆github.com/dor29494/my-app(分支:测试,提交:400d8a4)
15:00:00.829克隆已完成:1.072s
15:00:00.851正在分析源代码。。。
15:00:01.658正在安装生成运行时。。。
15:00:04.373安装的生成运行时:2.715s
15:00:06.725未提供生成缓存
15:00:07.847正在安装依赖项。。。
15:00:08.325 npm WARN read shrinkwrap此版本的npm与兼容lockfileVersion@1,但已为生成package-lock.jsonlockfileVersion@2. 我会尽力做到最好!
15:00:19.992>核心-js@3.6.5postinstall/vercel/path0/node_模块/core js
15:00:19.992>节点-e“try{require('./postinstall')}catch(e){}”
15:00:20.088    > protobufjs@6.10.2postinstall/vercel/path0/node_模块/protobufjs
15:00:20.088>节点脚本/后安装
15:00:20.443 npm警告可选跳过可选依赖项:fsevents@2.3.2(节点\单元模块/fsevents):
15:00:20.443 npm WARN notsup跳过可选依赖项:不支持的平台fsevents@2.3.2:通缉{“os”:“darwin”,“arch”:“any”}(当前:{“os”:“linux”,“arch”:“x64”})
15:00:20.445在12.152秒内添加了364名贡献者的539个包
15:00:20.626 31个包正在寻找资金
15:00:20.626运行“npm基金”了解详细信息
15:00:20.648检测到Next.js版本:10.0.8
15:00:20.649运行“npm运行构建”
15:00:20.861>学习-starter@0.1.0build/vercel/path0
15:00:20.861>下一次生成
15:00:21.906信息-创建优化的生产构建。。。
15:00:21.922注意:Next.js现在收集有关使用情况的完全匿名遥测数据。
15:00:21.922此信息用于形成Next.js的路线图并确定功能的优先级。
15:00:21.922通过访问以下URL,您可以了解更多信息,包括如果您不想参与此匿名计划,如何选择退出:
15:00:21.922    https://nextjs.org/telemetry
15:00:26.563未能编译。
15:00:26.563 ModuleNotFoundError:未找到模块:错误:无法在“/vercel/path0/node_modules/@material ui/core/node_modules/@material ui/styled engine”中解析“@emotion/styled”
15:00:26.563>发生生成错误
15:00:26.564错误:>由于网页包错误,生成失败
15:00:26.564 at/vercel/path0/node_modules/next/dist/build/index.js:15:918
15:00:26.564运行微任务()
15:00:26.564在处理和拒绝时(内部/process/task_queues.js:93:5)
15:00:26.564 at async/vercel/path0/node_modules/next/dist/build/tracer.js:3:470
15:00:26.578 npm错误!代码失效循环
15:00:26.578 npm错误!错误1
15:00:26.581 npm错误!学习-starter@0.1.0build:`下一个build`
15:00:26.581 npm错误!退出状态1
15:00:26.581 npm错误!
15:00:26.581 npm错误!学习失败-starter@0.1.0构建脚本。
15:00:26.581 npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
15:00:26.589 npm错误!此运行的完整日志可在以下位置找到:
15:00:26.589 npm错误/vercel/.npm/_logs/2021-05-19T12_00_26_582Z-debug.log
15:00:26.601错误:命令“npm运行生成”已退出,返回1

我几天前遇到了同样的问题。这是Vercel的错误。只要重建几次。对我来说,它在三次重建后建立成功。