首页 文章

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

提问于
浏览
1

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

    你're attempting to install into a project directory which will try to update the project' s package.json 文件添加依赖项 . 安装仍然有效 . 你会在 node_modules/solc 下找到它 .

    更好的方法是在全球安装它:

    npm install -g solc
    

相关问题