I’m trying to deploy the NextJS & Sanity starter template in Netlify. The starter template can be found Clean template
I’m trying to install the whole repo in netlify, in a second stadium I want to separate the studio (the studio is already deployed via Sanity and thus not needed and will only take additional time for loading).
The structure is not changed and I only added a netlify.toml
[build]
command = "npm install && npm run build"
publish = ".next"
base = "nextjs-app"
[[plugins]]
package = "@netlify/plugin-nextjs"
The .toml file is located in the nextjs-app folder.
The error from the deploy is:
Plugin "@netlify/plugin-nextjs" internal error
────────────────────────────────────────────────────────────────
Error message
Error: ENOENT: no such file or directory, scandir '/Users/uesername/my-website/nextjs-app/node_modules'
Plugin details
Package: @netlify/plugin-nextjs
Version: 5.9.2
Repository: git+https://github.com/opennextjs/opennextjs-netlify.git
npm link: https://www.npmjs.com/package/@netlify/plugin-nextjs
Report issues: https://github.com/opennextjs/opennextjs-netlify/issues
Error location
In "onBuild" event in "@netlify/plugin-nextjs" from netlify.toml and package.json
Error properties
{
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: '/Users/username/my-website/nextjs-app/node_modules'
}
Resolved config
build:
base: /Users/username/my-website/nextjs-app
command: npm install && npm run build
commandOrigin: config
publish: /Users/username/my-website/nextjs-app/.next
publishOrigin: config
plugins:
- inputs: {}
origin: config
package: '@netlify/plugin-nextjs'