throw new TypeError(version)(Vue打包)

142 阅读1分钟

原因分析:

版本问题

解决办法:

在semver.js(node_modules/semver/semver.js)里做了一些改动,代码如下:

// if ANY of the sets match ALL of its comparators, then pass
Range.prototype.test = function(version) {
return true;//(大概在1224行)
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;
};