'Error message : Deploy did not succeed: Deploy directory 'dist' does not exist

I'm try to deploy three js site on netlify. It's showing the deply error message like Error message : Deploy did not succeed: Deploy directory 'dist' does not exist Although site is buildedsuccessfully

{
  "name": "shuence",
  "version": "1.0.0",
  "description": "webpack starter",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "webpack-dev-server --output-public-path=/build/dist  --mode development --progress --open --hot",
    "build": "webpack --mode production --progress",
    "start": "node server.js",
    "heroku-postbuild": "webpack -p"
  },
  "author": " Shuence ",
  "license": "MIT",
  "devDependencies": {
    "@babel/core": "^7.4.3",
    "@babel/polyfill": "^7.4.3",
    "@babel/preset-env": "^7.4.3",
    "babel-loader": "^8.0.5",
    "compression-webpack-plugin": "^4.0.0",
    "webpack": "^4.43.0",
    "webpack-cli": "^3.3.12",
    "webpack-dev-server": "^3.11.0"
  },
  "dependencies": {
    "@tweenjs/tween.js": "^18.6.0",
    "ammo.js": "github:kripken/ammo.js",
    "dat.gui": "^0.7.7",
    "express": "^4.17.1",
    "raw-loader": "^4.0.2",
    "stats.js": "^0.17.0",
    "three": "^0.117.1"
  }
}


Solution 1:[1]

change the build command on package.json to nuxt generate or in the netlify build settings use nuxt generate instead of using yarn build in the build command.

then set target: 'serverless' on nuxt.config file.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mohammadreza Abdoli