您的位置:首页技术文章
文章详情页

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

【字号: 日期:2023-03-02 11:07:35浏览:32作者:猪猪

问题描述

最近想学习一下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:3at /Users/panda/graduateProject/demo1/markcook/node_modules/.1.0.13@portfinder/lib/portfinder.js:160:14at /Users/panda/graduateProject/demo1/markcook/node_modules/.1.5.2@async/lib/async.js:52:16at /Users/panda/graduateProject/demo1/markcook/node_modules/.1.5.2@async/lib/async.js:269:32at /Users/panda/graduateProject/demo1/markcook/node_modules/.1.5.2@async/lib/async.js:44:16at /Users/panda/graduateProject/demo1/markcook/node_modules/.1.0.13@portfinder/lib/portfinder.js:122:16at 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.0npm ERR! argv '/usr/local/bin/node' '/usr/local/bin/npm' 'run' 'dev'npm ERR! node v7.8.0npm ERR! npm v4.2.0npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! markcook2.0@ dev: webpack-dev-server --inline --hotnpm ERR! Exit status 1npm 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 --hotnpm ERR! You can get information on how to open an issue for this project with:npm ERR! npm bugs markcook2.0npm ERR! Or if that isn’t available, you can get their info via:npm ERR! npm owner ls markcook2.0npm 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`

问题解答

回答1:

clone 下来先 npm install, 再 npm run dev

回答2:

全局安装webpack再试试?

回答3:

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

回答4:

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

标签: JavaScript