【新手求帮助】 在学习https://travis-ci.org 自动集成测试时,编译出错
发布于 9 年前 作者 jwq5321594 3774 次浏览 最后一次编辑是 8 年前 来自 问答

具体错误信息地址

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/v5.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
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.13.0-40-generic
gyp ERR! command "/home/travis/.nvm/versions/node/v5.0.0/bin/node" "/home/travis/.nvm/versions/node/v5.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/travis/build/46602907/huiju/node_modules/bcrypt
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm ERR! Linux 3.13.0-40-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v5.0.0/bin/node" "/home/travis/.nvm/versions/node/v5.0.0/bin/npm" "install"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE
npm ERR! bcrypt@0.8.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bcrypt@0.8.5 install script 'node-gyp rebuild'.
npm ERR! 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
npm ERR! You can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: 

package.json内容 如下:

{
  "name": "huiju",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "make test"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/46602907/huiju"
  },
  "keywords": [
    "爬虫",
    "web推送"
  ],
  "author": "江文奇 杨伟 张佳懿 穆俊",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/46602907/huiju/issues"
  },
  "homepage": "https://github.com/46602907/huiju",
  "dependencies": {
    "async": "^1.5.0",
    "bcrypt": "^0.8.5",
    "cheerio": "^0.19.0",
    "eventproxy": "^0.3.4",
    "jade": "^1.11.0",
    "koa": "^1.1.1",
    "koa-logger": "^1.3.0",
    "koa-views": "^3.1.0",
    "moment": "^2.10.6",
    "mongoose": "^4.2.4",
    "newrelic": "^1.23.0",
    "q": "^1.4.1",
    "superagent": "^1.4.0"
  },
  "devDependencies": {
    "benchmark": "^1.0.0",
    "coveralls": "^2.11.4",
    "istanbul": "^0.4.0",
    "mocha": "^2.3.3",
    "mocha-lcov-reporter": "^1.0.0",
    "mocha-phantomjs": "^4.0.1",
    "should": "^7.1.1",
    "supertest": "^1.1.0"
  }
}

.travis.yml 配置文件如下:

language: node_js
node_js:
  - "node"
  - "iojs"
services:
  - mongodb
  - redis-server
before_script:
   sleep 15
   mongo huiju_test #--eval 'db.addUser("travis", "test");'
env:
  - dev=true
service_name: travis-pro
repo_token: C66RFjqQ1uG6Z43TJB7gmiyywUjL3dhpZ
script: make test-cov
after_success: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
1 回复

参考下这个https://github.com/jiangmiao/node-curl/issues/34 似乎是机器的一些东西还没装 sudo apt-get install libcurl3-dev

回到顶部