vue.js 'npm run serve'不在浏览器中初始化项目

mfpqipee  于 2022-12-19  发布在  Vue.js
关注(0)|答案(2)|浏览(120)

我正在运行'npm运行服务'命令来执行我的vue项目在浏览器中。但它没有给出任何输出或错误它只是继续运行enter image description here它只是停留在这里只有我已经尝试了每一件事我已经重新启动我的系统和重新安装vue-cli也但它没有工作。我昨天运行得很好但今天它不工作事实上它浪费了我一整天
我尝试了什么
执行“npm运行服务”命令
我的期望
在浏览器中打开我的项目

7kqas0il

7kqas0il1#

npm run serve将运行你的项目的构建版本。听起来你想在浏览器中本地运行它(用于开发和测试),应该使用npm run dev
npm run serve将仅提供npm run build命令的输出,并且通常仅在部署到实际服务器之后运行。

5w9g7ksd

5w9g7ksd2#

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

相关问题