2016-11-25 15 views
2

Node.js 7プロジェクトがTravisCIで動作するようにしようとしています。すべてがローカルに動作しますが、トラヴィスは、プロジェクトをテストしようとしたときに私が取得:Node-gypエラーでTravisCIが失敗する

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 
gyp ERR! stack  at ChildProcess.onExit (/home/travis/.nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23) 
gyp ERR! stack  at emitTwo (events.js:106:13) 
gyp ERR! stack  at ChildProcess.emit (events.js:191:7) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) 
gyp ERR! System Linux 4.8.7-040807-generic 
gyp ERR! command "/home/travis/.nvm/versions/node/v6.9.1/bin/node" "/home/travis/.nvm/versions/node/v6.9.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /home/travis/build/actuallymentor/react-node-boilerplate/node_modules/bcrypt 
gyp ERR! node -v v6.9.1 
gyp ERR! node-gyp -v v3.4.0 
gyp ERR! not ok 

そして:これは私のビルドでもテストを実行する前に失敗し

npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 bcrypt package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node-gyp rebuild 

を。

答えて

3

ここでの問題は、bcryptにはC++ライブラリの使用が必要であることです。 Travisにはこれがインストールされていません。それは我々が必要とする動作させるために:

  1. ライブラリをインストールし
  2. 設定し、我々はそれを

さらにノード-GYPは、私たちがいることを設定することができ、グローバルにインストールするのが好きを使用したい示す環境変数一度にも。あなたの.travis.ymlプットで

:また

sudo: required 
before_install: 
    - npm install -g node-gyp 
addons: 
    apt: 
    sources: 
    - ubuntu-toolchain-r-test 
    packages: 
    - g++-5 

、この環境変数を設定あなたのトラヴィスのプロジェクト設定での点を確認してください。4.8以上の任意のG ++のバージョンが動作する必要があることを

CXX=g++-5 

注意。

0

私のためのこの仕事!!!!

nodejs 4.6.2、トラヴィス

env: 
    - CXX=g++-4.8 
addons: 
    apt: 
    sources: 
    - ubuntu-toolchain-r-test 
    packages: 
    - g++-4.8 
にbcryp 1.0.1
関連する問題