搜索

首页  >  问答  >  正文

javascript - 关于clone vue2.0项目,运行不了的问题

最近想学习一下vue,然后看到了一个不错的项目。然后决定clone下来学习一下。
按照说明一步一步下来安装的,npm install,依赖都安装了的。
`
https://github.com/jrainlau/m...
这是项目地址,大佬们可以直接clone看一下
`

但是发现clone下来,使用项目说明,然后再最后(在mac环境下)
npm run dev
的时候报错。npm和node都升级到了最新的版本,最开始有提醒版本的问题。
不知道配置哪里出问题了,大佬求教。
下面是package配置:
`{

"name": "markcook2.0",
"description": "Markcook version 2.0",
"author": "Jrain Lau <jrainlau@gmail.com>",
"private": true,
"scripts": {
    "dev": "webpack-dev-server --inline --hot",
    "build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
    "font-awesome": "^4.6.3",
    "fontawesome": "^4.5.0",
    "highlight.js": "^9.7.0",
    "marked": "^0.3.6",
    "vue": "2.3.3",
    "xss": "^0.2.13"
},
"devDependencies": {
    "babel-core": "^6.0.0",
    "babel-loader": "^6.0.0",
    "babel-preset-es2015": "^6.0.0",
    "cross-env": "^3.0.0",
    "css-loader": "^0.25.0",
    "file-loader": "^0.9.0",
    "jspdf": "^1.3.2",
    "less": "^2.7.1",
    "less-loader": "^2.2.3",
    "vue-loader": "^9.4.0",
    "vuex": "^2.0.0-rc.6",
    "webpack": "^2.6.0",
    "webpack-dev-server": "^2.1.0-beta.0"
}

}`

具体报错
`
TypeError: webpack.validateSchema is not a function

at new Server (/Users/panda/graduateProject/demo1/markcook/node_modules/.2.4.5@webpack-dev-server/lib/Server.js:25:35)
at startDevServer (/Users/panda/graduateProject/demo1/markcook/node_modules/.2.4.5@webpack-dev-server/bin/webpack-dev-server.js:358:12)
at /Users/panda/graduateProject/demo1/markcook/node_modules/.2.4.5@webpack-dev-server/bin/webpack-dev-server.js:330:3
at /Users/panda/graduateProject/demo1/markcook/node_modules/.1.0.13@portfinder/lib/portfinder.js:160:14
at /Users/panda/graduateProject/demo1/markcook/node_modules/.1.5.2@async/lib/async.js:52:16
at /Users/panda/graduateProject/demo1/markcook/node_modules/.1.5.2@async/lib/async.js:269:32
at /Users/panda/graduateProject/demo1/markcook/node_modules/.1.5.2@async/lib/async.js:44:16
at /Users/panda/graduateProject/demo1/markcook/node_modules/.1.0.13@portfinder/lib/portfinder.js:122:16
at Server.onListen (/Users/panda/graduateProject/demo1/markcook/node_modules/.1.0.13@portfinder/lib/portfinder.js:45:7)
at Object.onceWrapper (events.js:293:19)

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! markcook2.0@ dev: webpack-dev-server --inline --hot
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the markcook2.0@ dev script 'webpack-dev-server --inline --hot'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the markcook2.0 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server --inline --hot
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs markcook2.0
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls markcook2.0
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/panda/.npm/_logs/2017-05-26T14_29_22_361Z-debug.log
`

PHP中文网PHP中文网2705 天前1102

全部回复(4)我来回复

  • 阿神

    阿神2017-07-05 10:59:58

    clone 下来先 npm install, 再 npm run dev

    回复
    0
  • 某草草

    某草草2017-07-05 10:59:58

    全局安装webpack再试试?

    回复
    0
  • 给我你的怀抱

    给我你的怀抱2017-07-05 10:59:58

    http://jrainlau.github.io/mar...
    这是项目地址,大佬们可以直接clone看一下

    回复
    0
  • 黄舟

    黄舟2017-07-05 10:59:58

    去掉版本号之前的下箭头,这里会更新最新的版本,并不一定会下载你需要的版本。正解。

    回复
    0
  • 取消回复