使用最新版本的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$

答案 0 :(得分:0)
您尝试安装到项目目录中,该目录将尝试更新项目的package.json
文件以添加依赖项。安装仍然有效。您可以在node_modules/solc
下找到它。
更好的方法是全局安装:
npm install -g solc