bitrinjani / r2

R2 Bitcoin Arbitrager is an automatic arbitrage trading system powered by Node.js + TypeScript.
MIT License
782 stars 259 forks source link

npm install時に発生するエラー #156

Closed daibuncho closed 4 years ago

daibuncho commented 4 years ago

当方、R2 Bitcoin Arbitragerを使用したく、 環境構築しておりますが、npm install時にエラーが出てしまい、 手詰まりになってしまいました。 ご支援いただければ幸いです。

【環境】 OS :AWSのMicrosoft Windows Server 2019 Base Node.jsのバージョン:12.16.2

【手順】 ①Node.jsをダウンロード ②Node.jsをインストール  ※インストール時の設定で、python、Microsoft Visual Studioなども併せてインストール ③リポジトリをダウンロード  git clone https://github.com/bitrinjani/r2.git ④r2フォルダに移動し、「npm install」

※node.js command promptは管理者権限で実行しています。

【エラー内容】 gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:310:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\Administrator\r2\node_modules\leveldown gyp ERR! node -v v12.16.2 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! leveldown@2.1.1 install: prebuild-install || node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the leveldown@2.1.1 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2020-04-13T17_04_06_058Z-debug.log

【試してみたこと】 FAQを参照し、以下2つを試してみましたが、 同様のエラーが出てしまいました。 ①nodistで、node.jsのバージョンのデフォルト状態を「8.5.0」にする。 ②npmをアップデート→npmのキャッシュを消す→インストール npm install -g npm npm cache clean npm install --no-bin-links

daibuncho commented 4 years ago

ohiro19さんが投稿いただいていたように、 下記サイトから「node-v8.9.4-x64.msi」をインストールすれば、 無事解決できました。 お騒がせいたしました。

https://nodejs.org/download/release/v8.9.4/