【问题标题】:why there are errors when i install solc compiler with npm?为什么我用 npm 安装 solc 编译器时会出现错误?
【发布时间】:2018-04-05 19:09:14
【问题描述】:

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

【问题讨论】:

    标签: javascript npm solidity


    【解决方案1】:

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

    更好的方法是全局安装:

    npm install -g solc
    

    【讨论】:

      猜你喜欢
      • 2013-08-14
      • 2014-06-08
      • 2021-09-08
      • 2014-03-03
      • 1970-01-01
      • 2011-07-10
      • 2015-05-14
      • 2020-07-09
      • 2021-07-25
      相关资源
      最近更新 更多