zoukankan      html  css  js  c++  java
  • nvmw install 失败. 需修改"Msxml2.XMLHTTP"为"Msxml2.ServerXMLHTTP"

    准备在windows下学习nodejs. 下载了nvmw . 但没法安装node的任何版本. 都是报错如下:

    C:UsersWXG>nvmw install v0.12.0 x86
    Start installing node/v0.12.0 (x32) to E:wxgGit
    vmwv0.12.0-x32
    Download from http://npm.taobao.org/mirrors/node/v0.12.0/node.exe, and save it as E:wxgGit
    vmwv0
    .12.0-x32
    ode.exe
    0 Unknown
    Download E:wxgGit
    vmwv0.12.0-x32
    ode.exe from http://npm.taobao.org/mirrors/node/v0.12.0/node.e
    xe failed
    
    C:UsersWXG>nvmw install node-v0.11.15
    Start installing node/v0.11.15 (x64) to E:wxgGit
    vmwv0.11.15
    Download from http://npm.taobao.org/mirrors/node/v0.11.15/x64/node.exe, and save it as E:wxgGit
    v
    mwv0.11.15
    ode.exe
    0 Unknown
    Download E:wxgGit
    vmwv0.11.15
    ode.exe from http://npm.taobao.org/mirrors/node/v0.11.15/x64/node
    .exe failed
    

    网上找不到类似错误,的解决办法. 幸好源码不多而且比较好懂. 我试着去定位问题的位置.

    然后发现出错在"fget.js"上.  需要修改下源文件.  'Msxml2.XMLHTTP' 改为 'Msxml2.ServerXMLHTTP'   注: 我是win7 64 位系统.

    function downloadFile(url, filename, callback) {
      //var xhr = WScript.createObject('Msxml2.XMLHTTP')
      var xhr = WScript.createObject('Msxml2.ServerXMLHTTP')
        , ostream = new ActiveXObject("Adodb.Stream");
    
      log('Download from ' + url + ', and save it as ' + filename);
    
      xhr.onreadystatechange = function() {
    

    以下是我的调试截图:

  • 相关阅读:
    shell脚本之数组
    shell脚本之函数
    shell脚本之sed
    shell脚本的for循环与read
    shell脚本之if语句
    shell脚本正则表达式
    shell的编程原理
    《梦断代码》阅读笔记03
    12.19学习总结
    《梦断代码》阅读笔记02
  • 原文地址:https://www.cnblogs.com/juedui0769/p/4920196.html
Copyright © 2011-2022 走看看