vue打包时semver.js版本报错

如图,报错semver.js版本不正确,解决思路是在node_modules/semver.js内,忽略版本检查

'''
// if ANY of the sets match ALL of its comparators, then pass
Range.prototype.test = function(version) {
// ignore the version of this file
return true;
// ignore the version of this file
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;
};
'''

如此,再次npm run build可以正常打包

posted @ 2019-05-22 16:49  飞天龙猫  阅读(1434)  评论(0编辑  收藏  举报