npm ERR missing script: server npm ERR npm ERR Did you mean this? npm ERR serve npm ERR A

博主在尝试使用npm run server时遇到missingscript错误,通过逐步排查和npminstall解决。文章详细介绍了如何修复npm missingscript:server问题并确保依赖正确安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

npm ERR! missing script: server npm ERR! npm ERR! Did you mean this? npm ERR! serve npm ERR! A complete log of this run can be found in:

遇到的bug是

npm ERR! missing script: server npm ERR! npm ERR! Did you mean this? npm ERR!     serve  npm ERR! A complete log of this run can be found in:

因为

npm  run server

看了很多博客还是没解决

于是我用了以下的办法解决

npm install

我的pack

{
  "name": "vueblog-vue",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",              
    "build": "vue-cli-service build"
  },
  "dependencies": {
    "axios": "^0.19.2",
    "core-js": "^3.6.4",
    "element-ui": "^2.13.1",
    "github-markdown-css": "^5.1.0",
    "markdown-it": "^11.0.0",
    "mavon-editor": "^2.9.0",
    "vue": "^2.6.11",
    "vue-router": "^3.1.6",
    "vuex": "^3.1.3"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.3.0",
    "@vue/cli-plugin-router": "~4.3.0",
    "@vue/cli-plugin-vuex": "~4.3.0",
    "@vue/cli-service": "~4.3.0",
    "vue-template-compiler": "^2.6.11"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

将 serve 和 build的后面那些下载一次

npm vue-cli-service serve
npm vue-cli-service build

然后再执行

npm run serve

如果报错误

 ERROR  Failed to compile with 1 errors                                                                     下午10:58:58

This dependency was not found:

* github-markdown-css in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modul
es/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/BlogDetail.vue?vue&t
ype=script&lang=js&

To install it, you can run: npm install --save github-markdown-css

跟着提示

再运行

npm install --save github-markdown-css

再运行

npm run serve
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值