我有以下依赖数组package.json
:
"dependencies": {
"doT": "git://github.com/nick-jonas/doT.git#cbc7041b646a79cca1034820db09167407d2f988",
"lodash": "latest",
"commander": "latest",
"minimatch": "0.2.9",
"prompt": "latest",
"mkdirp": "latest",
"fs-extra": ">=0.3.2",
"shelljs": ">=0.1.0",
"cheerio": ">=0.10.5",
"readdirp": ">=0.2.1"
}
注意第一个部门:
"doT": "git://github.com/nick-jonas/doT.git#cbc7041b646a79cca1034820db09167407d2f988"
这适用于 npm。运行时npm install
,它会将正确版本的 doT 放入我的 node_modules 目录中。然而,当 Travis-CI 运行测试脚本时,它会给出这个错误消息:
227 vows test/*.js --spec
228
229
230 module.js:340
231 throw err;
232 ^
233 Error: Cannot find module 'doT'
234 at Function.Module._resolveFilename (module.js:338:15)
235 at Function.Module._load (module.js:280:25)
236 at Module.require (module.js:362:17)
237 at require (module.js:378:17)
238 at Object.<anonymous> (/home/travis/builds/nick-jonas/assemblejs/lib/commands/writer.js:15:11)
239 at Module._compile (module.js:449:26)
240 at Object.Module._extensions..js (module.js:467:10)
241 at Module.load (module.js:356:32)
242 at Function.Module._load (module.js:312:12)
243 at Module.require (module.js:362:17)
244 npm ERR! Test failed. See above for more details.
245 npm ERR! not ok code 0
在本地运行此命令vows test/*.js --spec
也可以,因此我假设 Travis-CI 抓取散列 URL 依赖项存在问题。
其他人有类似的问题吗?