javascript - 运行别人vue项目的时候出现问题?

查看:317
本文介绍了javascript - 运行别人vue项目的时候出现问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

从git上clone下来的vue项目,直接npm install,然后npm run dev的时候每个项目都是报这样的错

npm ERR! missing script:dev

$ cnpm run dev
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\lpove\\AppData\\Roaming\\npm\\node_modules\\cnpm\\node_modules\\npm\\bin\\npm-cli.js" "--userconfig=C:\\Users\\lpove\\.cnpmrc" "--disturl=https://npm.taobao.org/mirrors/node" "--registry=https://registry.npm.taobao.org" "run" "dev"
npm ERR! node v7.2.1
npm ERR! npm  v3.10.10

npm ERR! missing script: dev
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     G:\program\new-learn\6th-vue.js\github\easy-vue\npm-debug.log

同样的使用npm也不行

$ npm run dev
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\lpove\\App                                                                                                                Data\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v7.2.1
npm ERR! npm  v4.0.5

npm ERR! missing script: dev
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     G:\program\new-learn\6th-vue.js\github\easy-vue\npm-debug.log

解决方案

查看一下package.json中scripts是否有dev,有可能是别的比如test啥的:

 "scripts": {
    "test": "webpack -p -d --colors",
    "build": "NODE_ENV=production webpack -p --colors"
  },

这时得运行npm run test

这篇关于javascript - 运行别人vue项目的时候出现问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆