«ImportError: нет модуля с именем pkg_resources» для Ubuntu 16.04 при установке ethereumjs. Как я могу это исправить?

Я следую этому учебнику, чтобы создать умные контракты Ethereum для краудсейла. Я использую Ubuntu 16.04, и я застрял в этой проблеме на несколько часов, и мне не посчастливилось ее решить. Я не смог найти ошибки, и некоторые из них были похожи, но ни одно из предложенных решений не сработало.

Когда я набираю:

npm install -g ethereumjs-testrpc

в терминале, я получаю следующие ошибки:

ImportError: No module named pkg_resources
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:354:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.16.0-77-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/scrypt
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
/usr/local/lib
└── (empty)

npm ERR! Linux 3.16.0-77-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "ethereumjs-testrpc"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the scrypt@6.0.3 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the scrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs scrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls scrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/fappycow/npm-debug.log
npm ERR! code 1

Есть идеи, как мне их исправить?

1
задан 16 June 2017 в 01:50

1 ответ

Ваша версия Node.js слишком стара. Как Вы видите из журнала ошибок, Ваша версия Node.js 4.2.6, но ethereum-testrpc "требует, по крайней мере, чтобы Узел 6.9.1 работал", как указано в https://github.com/ethereumjs/testrpc. Для установки Node.js> = 6.x, см. инструкции для Ubuntu в https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions, который я воспроизвожу дословно ниже:

  • Node.js 6.x

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
  • Node.js 8.x

    curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
0
ответ дан 8 December 2019 в 04:59

Другие вопросы по тегам:

Похожие вопросы: