Contract-Development

npm install - - 全域 @openzeppelin/cli 不工作

  • October 4, 2020

伙計們,我安裝了 node js 和 npm。

但是當我嘗試使用以下命令安裝 OpenZeppelin sdk 時:

npm install --global @openzeppelin/cli

它不安裝。我不知道出了什麼問題。但我認為也許圖書館現在已被棄用。

有的請幫幫我。

當我執行該命令時,它的行為就像它正在安裝一樣,但在此過程中會遇到錯誤。

錯誤如下圖:

C:\Users\jude\hd_wallet>npm install --global @openzeppelin/cli
npm WARN deprecated truffle-config@1.1.16: WARNING: This package has been rename
d to @truffle/config.
npm WARN deprecated typechain-target-truffle@1.0.2: For TypeChain 2.x use @typec
hain/truffle-v4 or v5
npm WARN deprecated typechain-target-web3-v1@1.0.4: For TypeChain 2.x use @typec
hain/web3-v1
npm WARN deprecated request@2.88.2: request has been deprecated, see https://git
hub.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer m
aintained. 'mkdirp' itself supports promises now, please switch to that.
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

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jude\AppData\Roaming\npm-cache\_logs\2020-09-25T10_55_49_4
71Z-debug.log

可能是什麼問題,我該如何解決?

npm 錯誤!enoent spawn git ENOENT npm 錯誤!enoent 這與 npm 找不到文件有關。

這表明未安裝 Git。其中一個依賴項需要安裝 Git。你可以從這裡下載它:https ://git-scm.com/downloads 。

引用自:https://ethereum.stackexchange.com/questions/88042