且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Travis-CI找不到相关的模块要求

更新时间:2023-09-20 13:32:46

此错误是因为我引用了 ./ sources / reddit reddit 小写,在文件系统上,文件为 Reddit ,大写字母为 R



Mac OSX的大小写敏感度很好,Linux则不然。

I have a Travis build job that is running mocha tests, however the build is failing with the error:

Error: Cannot find module './sources/reddit'

My file tree is the following

feeds/ 
     sources/ 
          Reddit.js
     Feeds.js
app.js

Within Feeds.js I am doing

var https   = require('https'),
    q       = require('q'),
    Reddit  = require('./sources/reddit');

However it seems to be flagging up an error loading it up.

This error is because I was referencing ./sources/reddit with reddit as lowercase, on the filesystem the file is Reddit with an uppercase R.

Mac OSX deals with case sensitivity well, Linux does not.