npm报错Invalid Version:

2022-05-30 00:25 阅读 1,444 views 次 npm报错Invalid Version:已关闭评论
修改后执行后再删除修改的这些代码
/usr/lib/node_modules/npm/node_modules/semver/classes/semver.js

    // don't run into trouble passing this.options around.
    this.includePrerelease = !!options.includePrerelease
          version=version.replace("alpha","")
          version=version.replace("beta","")
          version=version.replace("rc","")
          version=version.replace("-.1","")
          version=version.replace("-.0","")
          version=version.replace("-.2","")
          version=version.replace("-.3","")
          version=version.replace("-.4","")
          version=version.replace("-.5","")
          version=version.replace("-.6","")
          version=version.replace("-.7","")
          version=version.replace("-.8","")
          version=version.replace("-.9","")
          version=version.replace("-.10","")
          version=version.replace(".00",".0")
          version=version.replace(".01",".1")
          version=version.replace(".02",".2")
          version=version.replace(".03",".3")
          version=version.replace(".04",".4")
          version=version.replace(".05",".5")
          version=version.replace(".06",".6")
          version=version.replace(".07",".7")
          version=version.replace(".08",".8")
          version=version.replace(".09",".9")
          version=version.replace("-","")
          version=version.replace(".e756d73a","")
          version=version.replace(".f55d2212","")

          version=version.trim()
          let arrGfVer=version.split('.')
          if(arrGfVer.length>3){
            version=arrGfVer[0] + "." + arrGfVer[1] + "." +arrGfVer[2]
          }

   //gf  const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])

          const m=version.split('.')

    if (!m) {
      throw new TypeError(`Invalid Version: ${version}`)
    }
版权声明:本文著作权归原作者所有,欢迎分享本文,谢谢支持!
转载请注明:npm报错Invalid Version: | 文档
分类:电脑技术 标签:

评论已关闭!