microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.42k stars 28.62k forks source link

Error encountered in executing "yarn" command #79553

Closed fzxa closed 5 years ago

fzxa commented 5 years ago

ZANEWANG-MB0:vscode-source zanewang$ yarn yarn install v1.17.3 $ node build/npm/preinstall.js [1/4] πŸ” Resolving packages... [2/4] 🚚 Fetching packages... info vscode-windows-ca-certs@0.1.0: The platform "darwin" is incompatible with this module. info "vscode-windows-ca-certs@0.1.0" is an optional dependency and failed compatibility check. Excluding it from installation. info vscode-windows-registry@1.0.2: The platform "darwin" is incompatible with this module. info "vscode-windows-registry@1.0.2" is an optional dependency and failed compatibility check. Excluding it from installation. info windows-foreground-love@0.2.0: The platform "darwin" is incompatible with this module. info "windows-foreground-love@0.2.0" is an optional dependency and failed compatibility check. Excluding it from installation. info windows-mutex@0.3.0: The platform "darwin" is incompatible with this module. info "windows-mutex@0.3.0" is an optional dependency and failed compatibility check. Excluding it from installation. info windows-process-tree@0.2.4: The platform "darwin" is incompatible with this module. info "windows-process-tree@0.2.4" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] πŸ”— Linking dependencies... warning " > @microsoft/applicationinsights-web@2.1.1" has unmet peer dependency "tslib@^1.9.3". [4/4] πŸ”¨ Building fresh packages... [6/16] β‘€ nsfw [2/16] β‘€ native-is-elevated [3/16] β‘€ native-keymap [4/16] β‘€ native-watchdog error /Users/zanewang/repos/vscode-source/node_modules/native-keymap: Command failed. Exit code: 1 Command: node-gyp rebuild Arguments: Directory: /Users/zanewang/repos/vscode-source/node_modules/native-keymap Output: gyp info it worked if it ends with ok gyp info using node-gyp@3.8.0 gyp info using node@10.14.2 | darwin | x64 gyp http GET https://atom.io/download/electron/v4.2.9/node-v4.2.9-headers.tar.gz gyp WARN install got an error, rolling back install gyp ERR! configure error gyp ERR! stack Error: tunneling socket could not be established, statusCode=404 gyp ERR! stack at ClientRequest.onConnect (/usr/local/lib/node_modules/npm/node_modules/tunnel-agent/index.js:166:19) gyp ERR! stack at Object.onceWrapper (events.js:273:13) gyp ERR! stack at ClientRequest.emit (events.js:182:13) gyp ERR! stack at Socket.socketOnData (_http_client.js:475:11) gyp ERR! stack at Socket.emit (events.js:182:13) gyp ERR! stack at addChunk (_stream_readable.js:283:12) gyp ERR! stack at readableAddChunk (_stream_readable.js:264:11) gyp ERR! stack at Socket.Readable.push (_stream_readable.js:219:10) gyp ERR! stack at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) gyp ERR! System Darwin 17.7.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/zanewang/repos/vscode-source/node_modules/native-keymap

vscodebot[bot] commented 5 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

RMacfarlane commented 5 years ago

It looks like the download of electron is failing because of a network issue. Can you see if any of the solutions in https://github.com/atom/apm/issues/174 work for you?

fzxa commented 5 years ago

It looks like the download of electron is failing because of a network issue. Can you see if any of the solutions in atom/apm#174 work for you?

I've configure APM proxy, but the problem still exists.

sh-3.2# apm config list
; cli configs
globalconfig = "/var/root/.atom/.apm/.apmrc"
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.2.0 node/v10.2.1 darwin x64"
userconfig = "/var/root/.atom/.apmrc"

; environment configs
python = "/private/var/folders/_n/02hh01dn1kv88qsd4jwkkq200000gn/T/AppTranslocation/8590DFB2-62A2-41B1-B79F-F48CF509C5CA/d/Atom.app/Contents/Resources/app/apm/bin/python-interceptor.sh"

; userconfig /var/root/.atom/.apmrc
https-proxy = "https://registry.npm.taobao.org/"
strict-ssl = false

; globalconfig /var/root/.atom/.apm/.apmrc
cache = "/var/root/.atom/.apm"
progress = false

; node bin location = /private/var/folders/_n/02hh01dn1kv88qsd4jwkkq200000gn/T/AppTranslocation/8590DFB2-62A2-41B1-B79F-F48CF509C5CA/d/Atom.app/Contents/Resources/app/apm/bin/node
; cwd = /Users/zanewang/repos/vscode
; HOME = /var/root/.atom/.node-gyp
; "npm config ls -l" to show all defaults.

run β€œyarn” not work

[3/4] πŸ”—  Linking dependencies...
warning " > @microsoft/applicationinsights-web@2.1.1" has unmet peer dependency "tslib@^1.9.3".
[4/4] πŸ”¨  Building fresh packages...
[6/16] β‘€ nsfw
[2/16] β‘€ native-is-elevated
[3/16] β‘€ native-keymap
[4/16] β‘€ native-watchdog
error /Users/zanewang/repos/vscode/node_modules/native-is-elevated: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /Users/zanewang/repos/vscode/node_modules/native-is-elevated
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.14.2 | darwin | x64
gyp http GET https://atom.io/download/electron/v4.2.9/node-v4.2.9-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: tunneling socket could not be established, statusCode=404
gyp ERR! stack     at ClientRequest.onConnect (/usr/local/lib/node_modules/npm/node_modules/tunnel-agent/index.js:166:19)
gyp ERR! stack     at Object.onceWrapper (events.js:273:13)
gyp ERR! stack     at ClientRequest.emit (events.js:182:13)
gyp ERR! stack     at Socket.socketOnData (_http_client.js:475:11)
gyp ERR! stack     at Socket.emit (events.js:182:13)
gyp ERR! stack     at addChunk (_stream_readable.js:283:12)
gyp ERR! stack     at readableAddChunk (_stream_readable.js:264:11)
gyp ERR! stack     at Socket.Readable.push (_stream_readable.js:219:10)
gyp ERR! stack     at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/zanewang/repos/vscode/node_modules/native-is-elevated
rebornix commented 5 years ago

You can want to set up a global proxy otherwise yarn's requests are not proxied correctly, which leads to the network error.