vue npm run dev 報錯 semver\semver.js:312 throw new TypeError('Invalid Version: ' + version)


npm run dev運行報錯信息如下圖:

 

 

原因分析:

版本問題

解決辦法:

在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;//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;
};

去掉了檢查版本,就不報錯了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM