# Im having trouble deploying this next.js app

**URL:** <https://answers.netlify.com/t/im-having-trouble-deploying-this-next-js-app/73111>\
**Category:** Support\
**Tags:** create-react-app, netlify-newbie, nextjs\
**Created:** [August 9, 2022, 7:36pm UTC](https://answers.netlify.com/t/im-having-trouble-deploying-this-next-js-app/73111 "2022-08-09T19:36:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![z0rdian](https://avatars.discourse-cdn.com/v4/letter/z/bc8723/32.png) [@z0rdian](https://answers.netlify.com/u/z0rdian)\
**Post date:** [August 9, 2022, 7:36pm UTC](https://answers.netlify.com/t/im-having-trouble-deploying-this-next-js-app/73111/1 "2022-08-09T19:36:54Z")

</div>

Hello y’all!!!

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

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

```auto
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!

---

<div class="post-metadata">

**Author:** ![hillary](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hillary/32/21132_2.png) [@hillary](https://answers.netlify.com/u/hillary)\
**Post date:** [August 9, 2022, 10:49pm UTC](https://answers.netlify.com/t/im-having-trouble-deploying-this-next-js-app/73111/2 "2022-08-09T22:49:50Z")

</div>

Hey there, @z0rdian 👋

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.

---

<div class="post-metadata">

**Author:** ![z0rdian](https://avatars.discourse-cdn.com/v4/letter/z/bc8723/32.png) [@z0rdian](https://answers.netlify.com/u/z0rdian)\
**Post date:** [August 9, 2022, 11:38pm UTC](https://answers.netlify.com/t/im-having-trouble-deploying-this-next-js-app/73111/3 "2022-08-09T23:38:24Z")

</div>

Hello, @hillary 👋  
Thank you for your answer!

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

also this is the package.json file

```auto

{
    "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"
    }
}

```

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 10, 2022, 1:23pm UTC](https://answers.netlify.com/t/im-having-trouble-deploying-this-next-js-app/73111/5 "2022-08-10T13:23:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![z0rdian](https://avatars.discourse-cdn.com/v4/letter/z/bc8723/32.png) [@z0rdian](https://answers.netlify.com/u/z0rdian)\
**Post date:** [August 10, 2022, 4:21pm UTC](https://answers.netlify.com/t/im-having-trouble-deploying-this-next-js-app/73111/6 "2022-08-10T16:21:20Z")

</div>

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

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

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

```

and worked!\<

Thanks!

---

<div class="post-metadata">

**Author:** ![hillary](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hillary/32/21132_2.png) [@hillary](https://answers.netlify.com/u/hillary)\
**Post date:** [August 10, 2022, 9:23pm UTC](https://answers.netlify.com/t/im-having-trouble-deploying-this-next-js-app/73111/7 "2022-08-10T21:23:51Z")

</div>

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