Im having trouble deploying this next.js app

Hello y’all!!!

First off I want to say that I didnt check all netlify doc yet. :skull_and_crossbones:

I want to deploy this page but I keep getting this error:

4:25:01 PM: Build ready to start
4:25:05 PM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
4:25:05 PM: build-image tag: v4.10.1
4:25:05 PM: buildbot version: 2009834004fbab70d95494495d61f0ada38da28b
4:25:05 PM: Fetching cached dependencies
4:25:05 PM: Failed to fetch cache, continuing with build
4:25:05 PM: Starting to prepare the repo for build
4:25:05 PM: No cached dependencies found. Cloning fresh repo
4:25:05 PM: git clone https://github.com/z0rdian/amarilla-gh-page
4:25:06 PM: Preparing Git Reference refs/heads/main
4:25:06 PM: Parsing package.json dependencies
4:25:07 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: '.next' versus '' in the Netlify UI
4:25:07 PM: Starting build script
4:25:07 PM: Installing dependencies
4:25:07 PM: Python version set to 2.7
4:25:07 PM: Attempting node version '16.13.1
' from .nvmrc
4:25:08 PM: Version '16.13.1
' not found - try `nvm ls-remote` to browse available versions.
4:25:08 PM: Failed to install node version '16.13.1
'
4:25:08 PM: Build was terminated: Build script returned non-zero exit code: 1
4:25:08 PM: Creating deploy upload records
4:25:08 PM: Failing build: Failed to build site
4:25:08 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
4:25:08 PM: Finished processing build request in 3.161433103s

If anyones recognizes the error would you tell me what do I have to read?

Thanks!

Hey there, @z0rdian :wave:

Thanks for reaching out and welcome to the Netlify Forums! Can you please share a link to your site as well as your build settings? This will help us look into what you are encountering further.

Hello, @hillary :wave:
Thank you for your answer!

This is the github repository where the page is:
https://github.com/z0rdian/amarilla-gh-page

also this is the package.json file


{
    "name": "jamarilla-react",
    "version": "0.1.0",
    "private": true,
    "homepage": "http://z0rdian.github.io/amarilla-gh-page",
    "scripts": {
        "predeploy": "npm run build",
        "deploy": "gh-pages -d build",
        "dev": "next dev",
        "build":"next build",
        "export": "next export",
        "start": "next start",
        "lint": "next lint"
    },
    "dependencies": {
        "bootstrap": "5.1.3",
        "disqus-react": "^1.1.2",
        "gh-pages": "^4.0.0",
        "gray-matter": "^4.0.3",
        "next": "^12.1.0",
        "prop-types": "^15.8.1",
        "proptypes": "^1.1.0",
        "react": "17.0.2",
        "react-bootstrap": "^2.1.2",
        "react-countup": "^6.1.1",
        "react-dom": "17.0.2",
        "react-icons": "^4.3.1",
        "react-intersection-observer": "^8.33.1",
        "react-markdown": "^8.0.0",
        "sass": "^1.49.8",
        "swiper": "^6.8.4"
    },
    "devDependencies": {
        "eslint": "8.9.0",
        "eslint-config-next": "12.1.0",
        "@netlify/plugin-nextjs": "^4.0.0-beta.4"
    }
}

Hey @z0rdian,

What happens when you remove .npmrc file from your repo? Since you’re using Node 16 (and Netlify uses that as the default), I believe you don’t need that file. If you do wish to set a Node Version, there are additional ways available too, but let’s try to determine if that’s the error here.

Hey @hrishikesh. I deleted the file and .gitignore. Populated netlify.toml with:

[[plugins]]
package = "@netlify/plugin-nextjs"

[build]
command = "yarn next build"
publish = ".next"

and worked!<

Thanks!

1 Like

Thanks so much for coming back and sharing your solution-- we are glad you are unblocked here. Happy building :rocket: