Web3js
無法在 Windows 10 上安裝 web3
這是我嘗試在我的機器上安裝 web3 時遇到的錯誤。
安裝 git 後我還有另一個問題:
C:\Windows\system32> npm install web3 npm ERR! code ENOENT npm ERR! syscall spawn git npm ERR! path git npm ERR! errno ENOENT npm ERR! enoent Error while executing: npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/web3-js/WebSocket-Node.git npm ERR! enoent npm ERR! enoent npm ERR! enoent spawn git ENOENT npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent
0 info it worked if it ends with ok 1 verbose cli [ 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 'web3' 1 verbose cli ] 2 info using npm@6.11.3 3 info using node@v12.11.0 4 verbose npm-session aab7a7e3a168fc24 5 silly install loadCurrentTree 6 silly install readLocalPackageData 7 http fetch GET 200 https://registry.npmjs.org/web3 30ms (from cache) 8 silly pacote tag manifest for web3@latest fetched in 101ms 9 timing stage:loadCurrentTree Completed in 148ms ................. 834 http fetch GET 200 https://registry.npmjs.org/xhr2-cookies 13ms (from cache) 835 silly pacote version manifest for xhr2-cookies@1.1.0 fetched in 19ms 836 silly resolveWithNewModule xhr2-cookies@1.1.0 checking installable status 837 http fetch GET 304 https://registry.npmjs.org/cookiejar 59ms (from cache) 838 silly pacote range manifest for cookiejar@^2.1.1 fetched in 64ms 839 silly resolveWithNewModule cookiejar@2.1.2 checking installable status 840 http fetch GET 200 https://registry.npmjs.org/oboe 12ms (from cache) 841 silly pacote version manifest for oboe@2.1.4 fetched in 18ms 842 silly resolveWithNewModule oboe@2.1.4 checking installable status 843 http fetch GET 200 https://registry.npmjs.org/http-https 15ms (from cache) 844 silly pacote range manifest for http-https@^1.0.0 fetched in 21ms 845 silly resolveWithNewModule http-https@1.0.0 checking installable status 846 silly fetchPackageMetaData error for websocket@github:web3-js/WebSocket-Node#polyfill/globalThis Error while executing: 846 silly fetchPackageMetaData undefined ls-remote -h -t ssh://git@github.com/web3-js/WebSocket-Node.git 846 silly fetchPackageMetaData 846 silly fetchPackageMetaData 846 silly fetchPackageMetaData spawn git ENOENT 847 timing stage:rollbackFailedOptional Completed in 0ms 848 timing stage:runTopLevelLifecycles Completed in 8054ms 849 silly saveTree system32 849 silly saveTree +-- git@0.1.5 849 silly saveTree | `-- mime@1.2.9 849 silly saveTree +-- mime@1.2.9 849 silly saveTree `-- web3@1.2.1 849 silly saveTree +-- web3-bzz@1.2.1 849 silly saveTree | +-- got@9.6.0 849 silly saveTree | | +-- @sindresorhus/is@0.14.0 849 silly saveTree | | +-- @szmarczak/http-timer@1.1.2 849 silly saveTree | | | `-- defer-to-connect@1.0.2 849 silly saveTree | | +-- cacheable-request@6.1.0 849 silly saveTree | | | +-- clone-response@1.0.2 849 silly saveTree | | | | `-- mimic-response@1.0.1 849 silly saveTree | | | +-- get-stream@5.1.0 849 silly saveTree | | | | `-- pump@3.0.0 849 silly saveTree | | | | +-- end-of-stream@1.4.4 849 silly saveTree | | | | | `-- once@1.4.0 849 silly saveTree | | | | | `-- wrappy@1.0.2 849 silly saveTree | | | | `-- once@1.4.0 849 silly saveTree | | | +-- http-cache-semantics@4.0.3 849 silly saveTree | | | +-- keyv@3.1.0 849 silly saveTree | | | | `-- json-buffer@3.0.0 849 silly saveTree | | | +-- lowercase-keys@2.0.0 849 silly saveTree | | | +-- normalize-url@4.5.0 849 silly saveTree | | | `-- responselike@1.0.2 849 silly saveTree | | | `-- lowercase-keys@1.0.1 849 silly saveTree | | +-- decompress-response@3.3.0 849 silly saveTree | | +-- duplexer3@0.1.4 849 silly saveTree | | +-- get-stream@4.1.0 849 silly saveTree | | +-- lowercase-keys@1.0.1 849 silly saveTree | | +-- mimic-response@1.0.1 849 silly saveTree | | +-- p-cancelable@1.1.0 849 silly saveTree | | +-- to-readable-stream@1.0.0 849 silly saveTree | | `-- url-parse-lax@3.0.0 849 silly saveTree | | `-- prepend-http@2.0.0 849 silly saveTree | +-- swarm-js@0.1.39 849 silly saveTree | | +-- bluebird@3.5.5 849 silly saveTree | | +-- buffer@5.4.3 849 silly saveTree | | | +-- base64-js@1.3.1 849 silly saveTree | | | `-- ieee754@1.1.13 849 silly saveTree | | +-- decompress@4.2.0 849 silly saveTree | | | +-- decompress-tar@4.1.1 849 silly saveTree | | | | +-- file-type@5.2.0 849 silly saveTree | | | | +-- is-stream@1.1.0 849 silly saveTree | | | | `-- tar-stream@1.6.2 849 silly saveTree | | | | +-- bl@1.2.2 849 silly saveTree | | | | | +-- readable-stream@2.3.6 849 silly saveTree | | | | | | +-- core-util-is@1.0.2 849 silly saveTree | | | | | | +-- inherits@2.0.4 849 silly saveTree | | | | | | +-- isarray@1.0.0 849 silly saveTree | | | | | | +-- process-nextick-args@2.0.1 849 silly saveTree | | | | | | +-- safe-buffer@5.1.2 849 silly saveTree | | | | | | +-- string_decoder@1.1.1 849 silly saveTree | | | | | | | `-- safe-buffer@5.1.2 849 silly saveTree | | | | | | `-- util-deprecate@1.0.2 849 silly saveTree | | | | | `-- safe-buffer@5.2.0 849 silly saveTree | | | | +-- buffer-alloc@1.2.0 849 silly saveTree | | | | | +-- buffer-alloc-unsafe@1.1.0 849 silly saveTree | | | | | `-- buffer-fill@1.0.0 849 silly saveTree | | | | +-- fs-constants@1.0.0 849 silly saveTree | | | | +-- readable-stream@2.3.6 849 silly saveTree | | | | +-- to-buffer@1.1.1 849 silly saveTree | | | | `-- xtend@4.0.2 849 silly saveTree | | | +-- decompress-tarbz2@4.1.1 849 silly saveTree | | | | +-- file-type@6.2.0 849 silly saveTree | | | | +-- seek-bzip@1.0.5 849 silly saveTree | | | | | `-- commander@2.8.1 849 silly saveTree | | | | | `-- graceful-readlink@1.0.1 849 silly saveTree | | | | `-- unbzip2-stream@1.3.3 849 silly saveTree | | | | `-- through@2.3.8 849 silly saveTree | | | +-- decompress-targz@4.1.1 849 silly saveTree | | | +-- decompress-unzip@4.0.1 849 silly saveTree | | | | +-- file-type@3.9.0 849 silly saveTree | | | | +-- get-stream@2.3.1 849 silly saveTree | | | | | +-- object-assign@4.1.1 849 silly saveTree | | | | | `-- pinkie-promise@2.0.1 849 silly saveTree | | | | | `-- pinkie@2.0.4 849 silly saveTree | | | | +-- pify@2.3.0 849 silly saveTree | | | | `-- yauzl@2.10.0 849 silly saveTree | | | | +-- buffer-crc32@0.2.13 849 silly saveTree | | | | `-- fd-slicer@1.1.0 849 silly saveTree | | | | `-- pend@1.2.0 849 silly saveTree | | | +-- graceful-fs@4.2.2 849 silly saveTree | | | +-- make-dir@1.3.0 849 silly saveTree | | | | `-- pify@3.0.0 849 silly saveTree | | | +-- pify@2.3.0 849 silly saveTree | | | `-- strip-dirs@2.1.0 849 silly saveTree | | | `-- is-natural-number@4.0.1 849 silly saveTree | | +-- eth-lib@0.1.27 849 silly saveTree | | | +-- bn.js@4.11.8 849 silly saveTree | | | +-- elliptic@6.5.1 849 silly saveTree | | | | +-- brorand@1.1.0 849 silly saveTree | | | | +-- hash.js@1.1.7 849 silly saveTree | | | | | `-- minimalistic-assert@1.0.1 849 silly saveTree | | | | +-- hmac-drbg@1.0.1 849 silly saveTree | | | | | `-- minimalistic-crypto-utils@1.0.1 849 silly saveTree | | | | +-- minimalistic-assert@1.0.1 849 silly saveTree | | | | `-- minimalistic-crypto-utils@1.0.1 849 silly saveTree | | | +-- keccakjs@0.2.3 849 silly saveTree | | | | +-- browserify-sha3@0.0.4 849 silly saveTree | | | | | `-- js-sha3@0.6.1 849 silly saveTree | | | | `-- sha3@1.2.3 849 silly saveTree | | | | `-- nan@2.13.2 849 silly saveTree | | | +-- nano-json-stream-parser@0.1.2 849 silly saveTree | | | +-- servify@0.1.12 849 silly saveTree | | | | +-- body-parser@1.19.0 849 silly saveTree | | | | | +-- bytes@3.1.0 849 silly saveTree | | | | | +-- content-type@1.0.4 849 silly saveTree | | | | | +-- debug@2.6.9 849 silly saveTree | | | | | | `-- ms@2.0.0 849 silly saveTree | | | | | +-- depd@1.1.2 849 silly saveTree | | | | | +-- http-errors@1.7.2 849 silly saveTree | | | | | | +-- inherits@2.0.3 849 silly saveTree | | | | | | +-- setprototypeof@1.1.1 849 silly saveTree | | | | | | +-- statuses@1.5.0 849 silly saveTree | | | | | | `-- toidentifier@1.0.0 849 silly saveTree | | | | | +-- iconv-lite@0.4.24 849 silly saveTree | | | | | | `-- safer-buffer@2.1.2 849 silly saveTree | | | | | +-- on-finished@2.3.0 849 silly saveTree | | | | | | `-- ee-first@1.1.1 849 silly saveTree | | | | | +-- qs@6.7.0 849 silly saveTree | | | | | +-- raw-body@2.4.0 849 silly saveTree | | | | | | `-- unpipe@1.0.0 849 silly saveTree | | | | | `-- type-is@1.6.18 849 silly saveTree | | | | | +-- media-typer@0.3.0 849 silly saveTree | | | | | `-- mime-types@2.1.24 849 silly saveTree | | | | | `-- mime-db@1.40.0 849 silly saveTree | | | | +-- cors@2.8.5 849 silly saveTree | | | | | `-- vary@1.1.2 849 silly saveTree | | | | +-- express@4.17.1 849 silly saveTree | | | | | +-- accepts@1.3.7 849 silly saveTree | | | | | | `-- negotiator@0.6.2 849 silly saveTree | | | | | +-- array-flatten@1.1.1 849 silly saveTree | | | | | +-- content-disposition@0.5.3 849 silly saveTree | | | | | | `-- safe-buffer@5.1.2 849 silly saveTree | | | | | +-- cookie-signature@1.0.6 849 silly saveTree | | | | | +-- cookie@0.4.0 849 silly saveTree | | | | | +-- encodeurl@1.0.2 849 silly saveTree | | | | | +-- escape-html@1.0.3 849 silly saveTree | | | | | +-- etag@1.8.1 849 silly saveTree | | | | | +-- finalhandler@1.1.2 849 silly saveTree | | | | | | `-- parseurl@1.3.3 849 silly saveTree | | | | | +-- fresh@0.5.2 849 silly saveTree | | | | | +-- merge-descriptors@1.0.1 849 silly saveTree | | | | | +-- methods@1.1.2 849 silly saveTree | | | | | +-- parseurl@1.3.3 849 silly saveTree | | | | | +-- path-to-regexp@0.1.7 849 silly saveTree | | | | | +-- proxy-addr@2.0.5 849 silly saveTree | | | | | | +-- forwarded@0.1.2 849 silly saveTree | | | | | | `-- ipaddr.js@1.9.0 849 silly saveTree | | | | | +-- range-parser@1.2.1 849 silly saveTree | | | | | +-- safe-buffer@5.1.2 849 silly saveTree | | | | | +-- send@0.17.1 849 silly saveTree | | | | | | +-- destroy@1.0.4 849 silly saveTree | | | | | | +-- mime@1.6.0 849 silly saveTree | | | | | | `-- ms@2.1.1 849 silly saveTree | | | | | +-- serve-static@1.14.1 849 silly saveTree | | | | | `-- utils-merge@1.0.1 849 silly saveTree | | | | +-- request@2.88.0 849 silly saveTree | | | | | +-- aws-sign2@0.7.0 849 silly saveTree | | | | | +-- aws4@1.8.0 849 silly saveTree | | | | | +-- caseless@0.12.0 849 silly saveTree | | | | | +-- combined-stream@1.0.8 849 silly saveTree | | | | | | `-- delayed-stream@1.0.0 849 silly saveTree | | | | | +-- extend@3.0.2 849 silly saveTree | | | | | +-- forever-agent@0.6.1 849 silly saveTree | | | | | +-- form-data@2.3.3 849 silly saveTree | | | | | | `-- asynckit@0.4.0 849 silly saveTree | | | | | +-- har-validator@5.1.3 849 silly saveTree | | | | | | +-- ajv@6.10.2 849 silly saveTree | | | | | | | +-- fast-deep-equal@2.0.1 849 silly saveTree | | | | | | | +-- fast-json-stable-stringify@2.0.0 849 silly saveTree | | | | | | | +-- json-schema-traverse@0.4.1 849 silly saveTree | | | | | | | `-- uri-js@4.2.2 849 silly saveTree | | | | | | | `-- punycode@2.1.1 849 silly saveTree | | | | | | `-- har-schema@2.0.0 849 silly saveTree | | | | | +-- http-signature@1.2.0 849 silly saveTree | | | | | | +-- assert-plus@1.0.0 849 silly saveTree | | | | | | +-- jsprim@1.4.1 849 silly saveTree | | | | | | | +-- extsprintf@1.3.0 849 silly saveTree | | | | | | | +-- json-schema@0.2.3 849 silly saveTree | | | | | | | `-- verror@1.10.0 849 silly saveTree | | | | | | `-- sshpk@1.16.1 849 silly saveTree | | | | | | +-- asn1@0.2.4 849 silly saveTree | | | | | | +-- bcrypt-pbkdf@1.0.2 849 silly saveTree | | | | | | | `-- tweetnacl@0.14.5 849 silly saveTree | | | | | | +-- dashdash@1.14.1 849 silly saveTree | | | | | | +-- ecc-jsbn@0.1.2 849 silly saveTree | | | | | | | `-- jsbn@0.1.1 849 silly saveTree | | | | | | +-- getpass@0.1.7 849 silly saveTree | | | | | | +-- jsbn@0.1.1 849 silly saveTree | | | | | | `-- tweetnacl@0.14.5 849 silly saveTree | | | | | +-- is-typedarray@1.0.0 849 silly saveTree | | | | | +-- isstream@0.1.2 849 silly saveTree | | | | | +-- json-stringify-safe@5.0.1 849 silly saveTree | | | | | +-- oauth-sign@0.9.0 849 silly saveTree | | | | | +-- performance-now@2.1.0 849 silly saveTree | | | | | +-- qs@6.5.2 849 silly saveTree | | | | | +-- tough-cookie@2.4.3 849 silly saveTree | | | | | | +-- psl@1.4.0 849 silly saveTree | | | | | | `-- punycode@1.4.1 849 silly saveTree | | | | | +-- tunnel-agent@0.6.0 849 silly saveTree | | | | | `-- uuid@3.3.3 849 silly saveTree | | | | `-- xhr@2.5.0 849 silly saveTree | | | | +-- global@4.3.2 849 silly saveTree | | | | | +-- min-document@2.19.0 849 silly saveTree | | | | | | `-- dom-walk@0.1.1 849 silly saveTree | | | | | `-- process@0.5.2 849 silly saveTree | | | | +-- is-function@1.0.1 849 silly saveTree | | | | `-- parse-headers@2.0.2 849 silly saveTree | | | | +-- for-each@0.3.3 849 silly saveTree | | | | | `-- is-callable@1.1.4 849 silly saveTree | | | | `-- string.prototype.trim@1.2.0 849 silly saveTree | | | | +-- define-properties@1.1.3 849 silly saveTree | | | | | `-- object-keys@1.1.1 849 silly saveTree | | | | +-- es-abstract@1.14.2 849 silly saveTree | | | | | +-- es-to-primitive@1.2.0 849 silly saveTree | | | | | | +-- is-date-object@1.0.1 849 silly saveTree | | | | | | `-- is-symbol@1.0.2 849 silly saveTree | | | | | | `-- has-symbols@1.0.0 849 silly saveTree | | | | | +-- function-bind@1.1.1 849 silly saveTree | | | | | +-- has-symbols@1.0.0 849 silly saveTree | | | | | +-- has@1.0.3 849 silly saveTree | | | | | +-- is-regex@1.0.4 849 silly saveTree | | | | | +-- object-inspect@1.6.0 849 silly saveTree | | | | | +-- string.prototype.trimleft@2.1.0 849 silly saveTree | | | | | `-- string.prototype.trimright@2.1.0 849 silly saveTree | | | | `-- function-bind@1.1.1 849 silly saveTree | | | +-- ws@3.3.3 849 silly saveTree | | | | +-- async-limiter@1.0.1 849 silly saveTree | | | | +-- safe-buffer@5.1.2 849 silly saveTree | | | | `-- ultron@1.1.1 849 silly saveTree | | | `-- xhr-request-promise@0.1.2 849 silly saveTree | | | `-- xhr-request@1.1.0 849 silly saveTree | | | +-- buffer-to-arraybuffer@0.0.5 849 silly saveTree | | | +-- query-string@5.1.1 849 silly saveTree | | | | +-- decode-uri-component@0.2.0 849 silly saveTree | | | | `-- strict-uri-encode@1.1.0 849 silly saveTree | | | +-- simple-get@2.8.1 849 silly saveTree | | | | `-- simple-concat@1.0.0 849 silly saveTree | | | +-- timed-out@4.0.1 849 silly saveTree | | | `-- url-set-query@1.0.0 849 silly saveTree | | +-- fs-extra@4.0.3 849 silly saveTree | | | +-- jsonfile@4.0.0 849 silly saveTree | | | `-- universalify@0.1.2 849 silly saveTree | | +-- got@7.1.0 849 silly saveTree | | | +-- get-stream@3.0.0 849 silly saveTree | | | +-- is-plain-obj@1.1.0 849 silly saveTree | | | +-- is-retry-allowed@1.2.0 849 silly saveTree | | | +-- isurl@1.0.0 849 silly saveTree | | | | +-- has-to-string-tag-x@1.4.1 849 silly saveTree | | | | | `-- has-symbol-support-x@1.4.2 849 silly saveTree | | | | `-- is-object@1.0.1 849 silly saveTree | | | +-- p-cancelable@0.3.0 849 silly saveTree | | | +-- p-timeout@1.2.1 849 silly saveTree | | | | `-- p-finally@1.0.0 849 silly saveTree | | | +-- url-parse-lax@1.0.0 849 silly saveTree | | | | `-- prepend-http@1.0.4 849 silly saveTree | | | `-- url-to-options@1.0.1 849 silly saveTree | | +-- mime-types@2.1.24 849 silly saveTree | | +-- mkdirp-promise@5.0.1 849 silly saveTree | | | `-- mkdirp@0.5.1 849 silly saveTree | | | `-- minimist@0.0.8 849 silly saveTree | | +-- mock-fs@4.10.1 849 silly saveTree | | +-- setimmediate@1.0.5 849 silly saveTree | | +-- tar@4.4.13 849 silly saveTree | | | +-- chownr@1.1.3 849 silly saveTree | | | +-- fs-minipass@1.2.7 849 silly saveTree | | | | `-- minipass@2.9.0 849 silly saveTree | | | | `-- yallist@3.1.1 849 silly saveTree | | | +-- minipass@2.9.0 849 silly saveTree | | | +-- minizlib@1.3.3 849 silly saveTree | | | `-- yallist@3.1.1 849 silly saveTree | | `-- xhr-request-promise@0.1.2 849 silly saveTree | `-- underscore@1.9.1 849 silly saveTree +-- web3-core@1.2.1 849 silly saveTree | +-- web3-core-helpers@1.2.1 849 silly saveTree | | +-- web3-eth-iban@1.2.1 849 silly saveTree | | | `-- web3-utils@1.2.1 849 silly saveTree | | | +-- eth-lib@0.2.7 849 silly saveTree | | | +-- ethjs-unit@0.1.6 849 silly saveTree | | | | +-- bn.js@4.11.6 849 silly saveTree | | | | `-- number-to-bn@1.7.0 849 silly saveTree | | | | +-- bn.js@4.11.6 849 silly saveTree | | | | `-- strip-hex-prefix@1.0.0 849 silly saveTree | | | | `-- is-hex-prefixed@1.0.0 849 silly saveTree | | | +-- number-to-bn@1.7.0 849 silly saveTree | | | +-- randomhex@0.1.5 849 silly saveTree | | | `-- utf8@3.0.0 849 silly saveTree | | `-- web3-utils@1.2.1 849 silly saveTree | +-- web3-core-method@1.2.1 849 silly saveTree | | +-- web3-core-promievent@1.2.1 849 silly saveTree | | | +-- any-promise@1.3.0 849 silly saveTree | | | `-- eventemitter3@3.1.2 849 silly saveTree | | `-- web3-core-subscriptions@1.2.1 849 silly saveTree | +-- web3-core-requestmanager@1.2.1 849 silly saveTree | | +-- web3-providers-http@1.2.1 849 silly saveTree | | | `-- xhr2-cookies@1.1.0 849 silly saveTree | | | `-- cookiejar@2.1.2 849 silly saveTree | | +-- web3-providers-ipc@1.2.1 849 silly saveTree | | | `-- oboe@2.1.4 849 silly saveTree | | | `-- http-https@1.0.0 849 silly saveTree | | `-- web3-providers-ws@1.2.1 849 silly saveTree | `-- web3-utils@1.2.1 849 silly saveTree +-- web3-eth-personal@1.2.1 849 silly saveTree | `-- web3-net@1.2.1 849 silly saveTree +-- web3-eth@1.2.1 849 silly saveTree +-- web3-net@1.2.1 849 silly saveTree +-- web3-shh@1.2.1 849 silly saveTree `-- web3-utils@1.2.1 850 verbose stack Error: spawn git ENOENT 850 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19) 850 verbose stack at onErrorNT (internal/child_process.js:456:16) 850 verbose stack at processTicksAndRejections (internal/process/task_queues.js:80:21) 851 verbose cwd C:\Windows\system32 852 verbose Windows_NT 10.0.16299 853 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "web3" 854 verbose node v12.11.0 855 verbose npm v6.11.3 856 error code ENOENT 857 error syscall spawn git 858 error path git 859 error errno ENOENT 860 error enoent Error while executing: 860 error enoent undefined ls-remote -h -t ssh://git@github.com/web3-js/WebSocket-Node.git 860 error enoent 860 error enoent 860 error enoent spawn git ENOENT 861 error enoent This is related to npm not being able to find a file. 862 verbose exit [ 1, true ]
幫助將不勝感激!!!謝謝!
好的,感謝 Niklas Feurstein 指導我!
我使用
npm install --global windows-build-tools
.從外部源(Not
npm install git
)安裝 git 對我有用。之後
npm
開始神奇地工作以安裝我想要的一切。同樣在我以正常模式執行命令提示符之前,但為了使其工作,我需要在管理員模式下使用它。