windows 10 - asl 和@truffle/contract

windows 10 - npm i @truffle/contract

无法安装 truffle 合约,请参阅错误 1。

ERROR 1:

C:\Vote>npm i @truffle/contract

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\laure\AppData\Roaming\npm-cache_logs19-11-11T03_41_13_180Z-debug.log

我认为错误 2 的发生是因为我没有安装 truffle 合约,错误 2 也发生在本地网页上。

ERROR 2:

Uncaught (in promise) ReferenceError: TruffleContract is not defined

at Object.loadContract (app.js:56)

at async Object.load (app.js:8)

赠品是错误日志中的这一行:

npm ERR! enoent spawn git ENOENT

基本上就是没有找到命令git,无法执行

确保您已安装 git 并在 运行 再次执行此安装命令之前将其添加到您的环境 PATH 中。