首页 文章

Travis CI NodeJs构建在本地运行,但在Travis CI上获得了权限被拒绝

提问于
浏览
1

因此,当我在本地运行我的仓库中的mocha测试它工作得很好但是当我推送提交并且它在travis CI上运行时我不断收到此错误:

sh: 1: mocha: Permission denied

npm ERR! Test failed.  See above for more details.

我的 .travis.yml

language: node_js
node_js:
  - "6"

install:
-npm install

before_script: npm install -g mocha
before_script: chmod 0777 ./node_modules/.bin/mocha

的package.json

{
  "name": "skeletonapp",
  "version": "0.0.0",
  "description": "skeletonapp",
  "main": "index.js",
  "author": {
    "name": "li"
  },
  "scripts": {
    "test": "mocha"
  },
  "dependencies": {
    "chai": "^3.5.0",
    "mocha": "^3.1.2"
  }
}

文件结构

https://travis-ci.org/LiamDotPro/Travis-CI-NodeJS-Skeleton---Mocha-Chai/builds/173340318

test.js

var assert = require('assert');
describe('Array', function () {
    describe('#indexOf()', function () {
        it('should return -1 when the value is not present', function () {
            assert.equal(-1, [1, 2, 3].indexOf(4));
        });
    });
});

2 回答

相关问题