为什么我用npm安装solc编译器时出错?

时间:2018-04-05 19:09:14

标签: javascript npm solidity

使用最新版本的npm,但我无法成功安装编译器。



ash@ubuntu:~/inbox$ node -v
v8.11.1
ash@ubuntu:~/inbox$ npm -v
5.8.0
ash@ubuntu:~/inbox$ sudo npm install --save solc
npm WARN saveError ENOENT: no such file or directory, open '/home/ash/inbox/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/ash/inbox/package.json'
npm WARN webpack-cli@2.0.14 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN inbox No description
npm WARN inbox No repository field.
npm WARN inbox No README data
npm WARN inbox No license field.

+ solc@0.4.21
updated 1 package in 5.593s
ash@ubuntu:~/inbox$ 




enter image description here

1 个答案:

答案 0 :(得分:0)

您尝试安装到项目目录中,该目录将尝试更新项目的package.json文件以添加依赖项。安装仍然有效。您可以在node_modules/solc下找到它。

更好的方法是全局安装:

npm install -g solc