简体   繁体   English

尝试将Next.js应用程序部署到以开发人员模式运行的Zeit云时出错

[英]Error when attempting to deploy Next.js app to Zeit cloud, running in dev mode

I am unable to deploy my Next.js App to Zeit using the now command. 我无法使用now命令将Next.js应用程序部署到Zeit。

I tried uninstalling sass reinstalling npm i node-sass as well as npm i node-sass --force . 我尝试卸载sass重新安装npm i node-sass以及npm i node-sass --force None of this worked. 这些都不起作用。 I get the following error. 我收到以下错误。

Node Sass could not find a binding for your current environment: OS X 64-bit with Node XX.X.X

在此处输入图片说明

The application must deploy or at least run in dev mode 'now dev'. 应用程序必须部署或至少在“ now dev”开发模式下运行。 It runs fine in my local dev environment when I run 'npm run dev'. 当我运行'npm run dev'时,它在我的本地开发环境中运行良好。

How I fixed the problem was, I wrote a bash script that does the following steps. 解决问题的方法是,我编写了一个bash脚本,该脚本执行以下步骤。

# Delete build files

sudo rm -rd .next

# Delete node modules

sudo rm -rd node_modules

# Then I ran this without installing the node_modules again

now dev

When I let the zeit builder install the node_modules the test deployment worked like a charm. 当我让zeit构建器安装node_modules ,测试部署的工作就像一个魅力。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:运行开发服务器时元素类型无效 next.js - Error: Element type is invalid next.js when running dev server Next.js 未处理的运行时错误“无法加载脚本:/_next/static/chunks/...”仅在开发模式下触发 - Next.js Unhandled Runtime Error "Failed to load script: /_next/static/chunks/..." only triggered in dev mode Next.js - Eslint 不会在开发模式下对任何页面进行 linting(除了 pages/_app.js) - Next.js - Eslint is not linting any pages in dev mode (aside from pages/_app.js) 如何使用Passenger 部署Next.js 应用程序? - How to deploy Next.js app with Passenger? Next.js 应用程序在尝试实现谷歌 firebase 身份验证时崩溃 - Next.js app crashes when attempting to implement google firebase authentication 如何将 next.js 应用程序部署到 Gitlab / Github Pages? - How to deploy next.js app to Gitlab / Github Pages? 构建 next.js 应用程序时出错:无法解析“下一个/头” - Error when building next.js app: Can't resolve 'next/head' 在 Next.js (30s+) 中,在开发模式下加载页面非常慢,这是什么原因造成的? - Loading pages is extremely slow in dev mode in Next.js (30s+), what could be causing this? 基于在 Next.js 中运行 state 的应用程序的按钮可见性 - Button visibility based on app running state in Next.js 我尝试使用 vercel 创建一个 next.js webapp,但是当我尝试在 cmd 上运行 vercel dev 时,它给了我这个错误 - I try to create a next.js webapp with vercel, but when i try to run vercel dev on cmd, it gave me this error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM