Netlify Deploy Crash: Node Module can't be resolved

I’m getting trouble deploying an update on the dependencies on my site. I’ve recently removed firebase packages from the dependencies. But, now I’m getting this error:

Module not found: Error: Can’t resolve ‘sass-loader’ in ‘/opt/build/repo’

The Application is running into Nuxt and works fine locally, but Netlify cannot run it without crashes.

I already tried to:

  • Uninstall the node-sass and the sass-loader, and install again
  • Update the version of sass-loader
  • Clear the cache and deploy again

But the problem still

This is my package

{
  "name": "...",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate"
  },
  "dependencies": {
    "@airbrake/browser": "^2.1.7",
    "@nuxt/content": "^1.10.0",
    "@nuxtjs/google-analytics": "^2.4.0",
    "@nuxtjs/robots": "^2.5.0",
    "@nuxtjs/style-resources": "^1.2.1",
    "axios": "^0.21.4",
    "buefy": "^0.9.10",
    "bulma": "^0.9.3",
    "gsap": "3.5.1",
    "lodash": "^4.17.20",
    "nuxt": "^2.15.8",
    "nuxt-buefy": "^0.4.10",
    "snarkdown": "^2.0.0",
    "three": "^0.119.1",
    "vue-headroom": "^0.10.1",
    "vue-i18n": "^8.25.0",
    "vue-recaptcha": "^1.3.0"
  },
  "devDependencies": {
    "node-sass": "^4.14.1",
    "sass-loader": "^10.1.1"
  }
}

Again the Application works fine on my computer, but on Netlify, I’m getting this errors

Module not found: Error: Can’t resolve ‘sass-loader’ in ‘/opt/build/repo’

Hi @JoaoNogueira

Could you try moving node-sass and sass-loader from devDependencies to dependencies and see if that changes anything.