[英]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.