[Vuejs]-'npm run serve' is not initiallizing project in browser

0👍

npm run serve will run the built version of your project. It sound to me like you want to run it locally in the browser (for dev and testing) and should use npm run dev.

npm run serve will only serve the output of a npm run build command, and is usually only run after deploying to an actual server.

-1👍

{
  "name": "fer-07-project",
  "version": "1.0.0",
  "description": "",
  "main": "index.html",
  "scripts": {
    "lint": "eslint --fix --ext .js,.jsx .",
    "init-project": "npm install && npm-run-all init:*",
    "init:dirs": "mkdirp dist src/sass src/css src/vendor src/images src/js",
    "init:files": "touch README.md src/index.html src/sass/style.scss src/js/script.js",
    "init:gitignore": "curl https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore -o .gitignore",
    "init:gitignore:custom": "echo \"dist\" >> .gitignore",
    "test": "npm-run-all test:*",
    "test:html": "globstar nu-html-checker dist/*.html",
    "test:js": "eslint src/js/ --fix",
    "test:scss": "stylelint src/sass/",
    "build": "npm-run-all build:* test",
    "build:clean": "mkdirp dist && rm -r dist && mkdirp dist",
    "build:copy": "copyfiles -a -u 1 -e \"**/sass/**/*\" -e \"**/.gitkeep\" \"src/**/*\" dist",
    "build:sass": "node-sass --output-style compact -o dist/css src/sass",
    "build:autoprefixer": "globstar autoprefixer-cli \"dist/css/*.css\"",
    "build-dev": "npm-run-all build-dev:sass build:autoprefixer",
    "build-dev:sass": "node-sass --output-style expanded --source-map true -o dist/css src/sass",
    "server": "json-server --port 3131 --no-cors --delay 250 --watch dist/db/app.json",
    "watch": "npm-run-all build build-dev -p watch:* server",
    "watch:browsersync": "browser-sync start --server dist --files \"dist/**/*\" --ignore \"dist/db/**/*\"",
    "watch:sassprefixer": "onchange \"src/sass/**/*.scss\" -- npm run build-dev",
    "watch:copy": "onchange -e \"**/sass/**/*\" -e \"**/.gitkeep\" \"src/**/*\" -- copyfiles -a -u 1 {{changed}} dist"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "flatpickr": "^4.6.9",
    "json-server": "^0.16.3",
    "rangeslider-pure": "^0.4.11"
  },
  "devDependencies": {
    "autoprefixer-cli": "^1.0.0",
    "browser-sync": "^2.26.3",
    "copyfiles": "^2.1.0",
    "eslint": "^5.14.1",
    "globstar": "^1.0.0",
    "mkdirp": "^0.5.1",
    "node-sass": "^4.11.0",
    "npm-run-all": "^4.1.5",
    "nu-html-checker": "^0.1.0",
    "onchange": "^5.2.0",
    "stylelint": "^9.10.1",
    "stylelint-scss": "^3.5.4"
  }
}

Leave a comment