npm run dev运行报错信息以下图:node
缘由分析:npm
版本问题this
解决办法:spa
在semver.js(node_modules/semver/semver.js)里作了一些改动,代码以下:prototype
// if ANY of the sets match ALL of its comparators, then pass Range.prototype.test = function(version) { return true;//add 2019年3月6日13:34:50 if (!version) return false; if (typeof version === 'string') version = new SemVer(version, this.options); for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) return true; } return false; };
去掉了检查版本,就不报错了code