【发布时间】:2017-01-06 00:23:54
【问题描述】:
我们的团队使用 Node.js 服务器制作了一个项目,并使用 GitHub 作为源代码控制。问题是我什么时候运行服务器。我使用后续步骤来测试 master 是否会启动应用程序。
git checkout master
git pull
npm update
node .\backend\server.js
最后一条评论给了我下一个错误。
D:\***\node_modules\passport-oauth2\lib\strategy.js:82
if (!options.clientID) { throw new TypeError('OAuth2Strategy requires a clientID option'); }
^
TypeError: OAuth2Strategy requires a clientID option
at Strategy.OAuth2Strategy (D:\Documenten\WatchFriends\Web\node_modules\passport-oauth2\lib\strategy.js:82:34)
at new Strategy (D:\Documenten\WatchFriends\Web\node_modules\passport-google-oauth20\lib\strategy.js:52:18)
at module.exports.config (D:\Documenten\WatchFriends\Web\backend\data\passport.js:94:18)
at Object.<anonymous> (D:\Documenten\WatchFriends\Web\backend\server.js:16:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
其他团队合作伙伴也在同一个存储库上工作,他们已经完成了相同的步骤来测试 master 是否会运行。奇怪的问题是他们没有任何问题。被.gitignore文件忽略的配置文件也是相等的。
问题:代码不能在我的电脑上运行而在其他电脑上运行的问题是什么?
我已尝试从 GitHub 删除并重新克隆项目,重新安装节点模块并添加被忽略的文件。但这并不能解决错误。我正在使用节点版本 6.9.3 和 git 版本 2.10.2.windows.1。
更新:
- 这里是我们的 GitHub 项目的链接:github.com/WatchFriends/Web
- 这是 Travis 的构建状态(只是检查一些 gulp 任务,还有
npm run build) - 这里是 Travis 的链接:travis-ci.org/WatchFriends/Web
-
Travis的配置:
./.travis.ymlon GitHubinstall: - npm install - npm install -g angular-cli language: node_js script: - gulp html - gulp scss - gulp ts - gulp node node_js: - "6.9" cache: directories: - node_modules - bower_components
【问题讨论】:
-
您应该比较您的 PC 和团队成员 PC 上的环境变量
-
它显然缺少一些东西,也许有一个配置文件夹或文件,你必须先设置一些东西? strategy.js 第 82 行发生了什么?