2014-12-02 81 views
0

Background_Note: 我已經在所有全局/主機中成功安裝了量角器。但是這同樣不適用於虛擬機。網絡連接ETIMEDOUT用於虛擬機中的量角器instarltion

也就是說,只有在Windows 7虛擬機中才會出現此問題,否則不會。 所有這些機器(VM,主機和單個機器)具有相同的代理設置,並且我在npm配置中設置了相同的地方。

npm config set proxy http://proxy_server:8080 
 
npm config set https-proxy http://proxy_server:8080


現在的程序我想:

  1. 我在Windows 7遠程桌面(VM),登錄的非管理員用戶
  2. 我以管理員身份打開了cmd窗口。
  3. 嘗試安裝量角器作爲

npm install -g protractor

  • 此安裝失敗,日誌和配置列表如下附接。
  • 嘗試所有可能的答案從Bower error tunneling socket could not be established, cause=Parse Error ==>他們不適合我。
  • C:\Windows\system32>npm config list 
     
    ; cli configs 
     
    registry = "http://registry.npmjs.org/" 
     
    user-agent = "npm/1.4.28 node/v0.10.33 win32 x64" 
     
    
     
    ; userconfig C:\Users\test\.npmrc 
     
    registry = "http://registry.npmjs.org/" 
     
    
     
    ; builtin config undefined 
     
    prefix = "C:\\Users\\test\\AppData\\Roaming\\npm" 
     
    
     
    ; node bin location = C:\Program Files\nodejs\\node.exe 
     
    ; cwd = C:\Windows\system32 
     
    ; HOME = C:\Users\test 
     
    ; 'npm config ls -l' to show all defaults.

    C:\ Windows \ System32下>

    登錄在NPM-寫的debug.log:

    0 info it worked if it ends with ok 
     
    1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe', 
     
    1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 
     
    1 verbose cli 'install', 
     
    1 verbose cli '-g', 
     
    1 verbose cli 'protractor', 
     
    1 verbose cli '--registry', 
     
    1 verbose cli 'http://registry.npmjs.org/' ] 
     
    2 info using [email protected] 
     
    3 info using [email protected] 
     
    4 verbose node symlink C:\Program Files\nodejs\\node.exe 
     
    5 verbose cache add [ 'protractor', null ] 
     
    6 verbose cache add name=undefined spec="protractor" args=["protractor",null] 
     
    7 verbose parsed url { protocol: null, 
     
    7 verbose parsed url slashes: null, 
     
    7 verbose parsed url auth: null, 
     
    7 verbose parsed url host: null, 
     
    7 verbose parsed url port: null, 
     
    7 verbose parsed url hostname: null, 
     
    7 verbose parsed url hash: null, 
     
    7 verbose parsed url search: null, 
     
    7 verbose parsed url query: null, 
     
    7 verbose parsed url pathname: 'protractor', 
     
    7 verbose parsed url path: 'protractor', 
     
    7 verbose parsed url href: 'protractor' } 
     
    8 silly lockFile 4f4f4858-protractor protractor 
     
    9 verbose lock protractor C:\Users\test\AppData\Roaming\npm-cache\4f4f4858-protractor.lock 
     
    10 silly lockFile 4f4f4858-protractor protractor 
     
    11 silly lockFile 4f4f4858-protractor protractor 
     
    12 verbose addNamed [ 'protractor', '' ] 
     
    13 verbose addNamed [ null, '*' ] 
     
    14 silly lockFile 80d5ca5a-protractor [email protected] 
     
    15 verbose lock [email protected] C:\Users\test\AppData\Roaming\npm-cache\80d5ca5a-protractor.lock 
     
    16 silly addNameRange { name: 'protractor', range: '*', hasData: false } 
     
    17 verbose request where is /protractor 
     
    18 verbose request registry http://registry.npmjs.org/ 
     
    19 verbose request id b468ffda57abdf0d 
     
    20 verbose url raw /protractor 
     
    21 verbose url resolving [ 'http://registry.npmjs.org/', './protractor' ] 
     
    22 verbose url resolved http://registry.npmjs.org/protractor 
     
    23 verbose request where is http://registry.npmjs.org/protractor 
     
    24 info trying registry request attempt 1 at 18:20:15 
     
    25 http GET http://registry.npmjs.org/protractor 
     
    26 info retry will retry, error on last attempt: Error: connect ETIMEDOUT 
     
    27 info trying registry request attempt 2 at 18:20:47 
     
    28 http GET http://registry.npmjs.org/protractor 
     
    29 info retry will retry, error on last attempt: Error: connect ETIMEDOUT 
     
    30 info trying registry request attempt 3 at 18:22:08 
     
    31 http GET http://registry.npmjs.org/protractor 
     
    32 silly lockFile 80d5ca5a-protractor [email protected] 
     
    33 silly lockFile 80d5ca5a-protractor [email protected] 
     
    34 error network connect ETIMEDOUT 
     
    34 error network This is most likely not a problem with npm itself 
     
    34 error network and is related to network connectivity. 
     
    34 error network In most cases you are behind a proxy or have bad network settings. 
     
    34 error network 
     
    34 error network If you are behind a proxy, please make sure that the 
     
    34 error network 'proxy' config is set properly. See: 'npm help config' 
     
    35 error System Windows_NT 6.1.7600 
     
    36 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "protractor" "--registry" "http://registry.npmjs.org/" 
     
    37 error cwd C:\Windows\system32 
     
    38 error node -v v0.10.33 
     
    39 error npm -v 1.4.28 
     
    40 error syscall connect 
     
    41 error code ETIMEDOUT 
     
    42 error errno ETIMEDOUT 
     
    43 verbose exit [ 1, true ]

    回答

    1

    解決。 當使用虛擬機並且它具有一定的代理集時,請使用全局代理(這是所有其他代理的根目錄)。 所以,在安裝前量角器運行這兩個命令:

    C:\Windows\system32>npm config set registry "http://registry.npmjs.org/" 
     
    C:\Windows\system32>npm config set proxy http://global.proxy.alcatel-lucent.com:8000

    解決了這個問題