Issues encountered during the deployment process on Vercel

I've encountered an issue while deploying my Next.js app on Vercel. It seems to be related to an unsupported platform error. I have attached an image displaying the exact error message.

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for @next/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ddaeaabef0b9bcafaab4b3f0a5ebe99deceef3e9f3ef">[email protected]</a>: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  x64
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR!     /vercel/.npm/_logs/2023-05-30T18_43_56_771Z-debug-0.log
Error: Command "npm install" exited with 1
BUILD_UTILS_SPAWN_1: Command "npm install" exited with 1

To troubleshoot, I have deleted package.lock.json and node.modules, reinstalled npm, but the problem persists.

Answer №1

It seems that the error message is indicating a problem related to the package @next/swc-darwin-x64, designed specifically for the Darwin (macOS) platform, being used on a Linux platform during Vercel deployment.

  • To resolve this issue, start by removing the @next/swc-darwin-x64 package from your package.json file. As it is platform-specific, it can cause conflicts in a Linux environment.

  • Next, install the @next/swc-linux-x64 package, which is compatible with Vercel's Linux-based deployment. Execute the following commands:

    npm uninstall @next/swc-darwin-x64
    npm install @next/swc-linux-x64
    
  • Once these steps are completed, proceed to push your changes and redeploy your application.

If there are no direct dependencies on @next/swc-*, consider checking your Next.js version or other packages that may indirectly include @next/swc-darwin-x64 as a dependency.

For more information, you can refer to the related Vercel issue at: https://github.com/vercel/next.js/issues/37651

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When dealing with arrays, the parentElement.remove() function may not be defined

Query: e1.parentElement.remove(); is not defined debug: e1 contains a value. e1.remove() removes a button, however, I need to remove a group of buttons. global variable and function execution var x = 0; AllResponses(null, null); primary function featuri ...

Why am I experiencing a problem with my ajax call only working once when I submit forms that are rendered with @Html.Render

I have a scenario where my index page loads with two partial views, each containing an ajax call that filters content based on date. The issue I'm facing is that the ajax call only works once successfully, and subsequent attempts cause a full page ref ...

What is the best way to achieve the functionality of this ajax jquery using vanilla JavaScript?

I am attempting to replicate this jQuery ajax POST request in Vanilla JS, which currently looks like: $.ajax({ method: 'POST', url: window.location.href + 'email', data: { toEmail: to, fromName: from, ...

How can I only replace every second occurrence in a JS string?

Looking for help with JavaScript: "a a a a".replace(/(^|\s)a(\s|$)/g, '$1') I thought the result would be '', but it's showing 'a a' instead. Can someone explain what I'm missing? To clarify, I want to r ...

Obtain the content enclosed by HTML tags

Looking to extract text between html tags? Imagine having a list of cities in California, each within paragraph tags. Can you retrieve only the text inside the paragraph tags? <div class="cities"> <div><p>Los Angeles</p><h5 ...

Executing a js.erb template while submitting a form with AJAX in a Rails application

My form setup looks like this: <div class= "parent-container"> <%= form_with scope: @company, url: companies_path, html: { class: "form-inline", remote: true, "data-type" => :js, id: "new-company-create" }, local: true do |f| %> <d ...

Tips for shutting down the pop-up notification with Playwright?

Recently, I delved into the Playwright API and started working on an automation test. The test revolves around logging into a bank account and performing a specific action. However, I encountered a roadblock when a message box popped up on the bank's ...

A method to transfer a floating point number from Python to JavaScript without using cgi

Running an Apache server from a Raspberry Pi, I have a Python script that prints sensor input to the console. A PHP script then processes this output and controls a light based on the sensor reading before printing it again. Everything works fine when exec ...

Using array.map() in React does not display elements side by side within a grid container

I'm currently working with React and material-ui in order to achieve my goal of displaying a grid container that is populated by an array from an external JavaScript file. The challenge I am facing is getting the grid to show 3 items per row, as it is ...

Which SSO framework works best for integrating Facebook and Twitter logins?

I own a website and I'm looking for a way to let users leave reviews and rate products. I need an SSO system that allows them to sign in with their Facebook or Twitter accounts and ensures each user is uniquely identified so they can't rate produ ...

Leveraging a PNG graphic within a NextJS application

I am currently working on a NextJS app and I want to incorporate a .png image into it. The app is being hosted on Firebase. After referring to the documentation on https://nextjs.org/docs/api-reference/next/image, I also came across this resource: https:/ ...

Troubiling Responsive Menu in React

I am currently working on developing a React Responsive Navigation with SCSS, but I am facing an issue. When I click on the hamburger button, nothing happens and the menu does not slide down in the mobile view. I tried inspecting the code in the browser to ...

Combining two JSON datasets and presenting the merged information

I need help parsing two sets of json data from the following URLs: https://raw.githubusercontent.com/openfootball/football.json/master/2015-16/en.1.json https://raw.githubusercontent.com/openfootball/football.json/master/2016-17/en.1.json My goal is to di ...

mongojs implementation that allows for asynchronous query execution without blocking

Forgive me for asking what may seem like a silly question, but I am struggling to make this work. Currently, as part of my learning journey with node.js and mongojs, I have encountered the following issue: Below is my server.js file server.get("/", funct ...

Check to see if a variable has been assigned a value in the form of a jquery

Scenario: <div> <div class="application-section active"></div> <div class="application-section"></div> </div> I need to define the following variables var $activeSection = $("div.application-section.active") ...

Combining ReactJS event handling for onClick and onKeyDown into a single handler for TypeScript

To ensure accessibility compliance, I am incorporating onKeyPress handlers into my application. However, I am facing a challenge with interactive <div /> elements. Here are the event handlers I want to trigger on click: const handleViewInfoClick = ( ...

Creating atomic controller actions in Sails.js: A guide to optimizing your controller functions

If I am looking to perform multiple operations within a Sails.js controller, how can I ensure that these actions are atomic to maintain the correctness of the results? This includes not only database operations but also various Javascript processing tasks. ...

Manually incorporating multiple React components into a single container

I am currently in the process of upgrading an old JavaScript application that relies heavily on jQuery by introducing some React components. The existing code utilizes JS/jQuery to dynamically add elements to the DOM, and I am looking for a way to replace ...

What is the solution to incorporating a scrollbar in a popup when I increase the zoom level?

When trying to add a scrollbar to the popup, I am facing an issue where the scrollbar does not appear when zoomed in to 75% or 100%. It works fine for fit screen but not on zoom. Can anyone help me identify what is wrong with my code and suggest how to han ...

The issue of infinite rendering caused by useState and how to effectively resolve it

I'm facing a strange issue in just a few lines of code, and I can't quite figure out what's happening behind the scenes. Here are the 4 lines causing trouble: function FarmerComponent(props) { let authCtx = useContext(AuthContext) let u ...