【问题标题】:npm error "Keccak bindings compilation fail." while installing trufflenpm 错误“Keccak 绑定编译失败。”在安装松露时
【发布时间】:2019-01-24 09:01:17
【问题描述】:

我尝试安装 Truffle,但随后出现此错误:

$ npm install -g truffle
    C:\Users\dany.vandermeij\AppData\Roaming\npm\truffle -> C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js

> keccak@1.4.0 install C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\truffle\node_modules\keccak
> npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."


> keccak@1.4.0 rebuild C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\truffle\node_modules\keccak
> node-gyp rebuild


C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\truffle\node_modules\keccak>if not defined npm_config_node_gyp (node "C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\dany.vandermeij\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:275:12)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\dany.vandermeij\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\truffle\node_modules\keccak
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keccak@1.4.0 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keccak@1.4.0 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\dany.vandermeij\AppData\Roaming\npm-cache\_logs\2019-01-22T09_38_03_836Z-debug.log
"Keccak bindings compilation fail. Pure JS implementation will be used."
+ truffle@5.0.2
added 89 packages from 304 contributors and updated 1 package in 14.582s

我测试了 truffle 命令,它们似乎可以工作,但我不知道为什么会出现此错误...

(我需要更多文字,所以这里有一个超级棒的 Hacker Ipsum:Haxx0r ipsum,它是一个功能客户端 python 否则是数据包嗅探器时代套接字。Dennis Ritchie 堆栈竞争条件 pwnedwarez James T. Kirk 适当的小值。Gc继续 sql packet alloc jumpfrog less gcc shell bytes protected.)

感谢您的帮助

【问题讨论】:

    标签: node.js npm npm-install truffle keccak


    【解决方案1】:

    使用 npm install -g truffle --unsafe-perm 安装 truffle 这可能是由于 keccak 的语法问题而发生的,它不应该影响功能。

    更新(Windows)

    npm install --global windows-build-tools
    

    【讨论】:

    • 能够复制问题并使用它修复它,我会重新检查,你能用 sudo 试试这个并检查。
    • 我用的是windows,但我在管理员模式下用cmd试试
    • 好吧,抱歉,您还需要更新的代码行。但它应该适用于刚刚检查过的 Windows 10 的更新版本
    猜你喜欢
    • 1970-01-01
    • 2022-06-25
    • 2014-06-01
    • 2021-07-17
    • 2012-11-23
    • 2018-11-17
    • 2020-03-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多