Nodejs CI依赖性错误

我正在为NodeJS应用程序设置持续集成/连续部署,并在npm install / dependencypipe理中遇到一些问题。

  • 在本地运行testing通过确定。
  • 在TravisCI或CodeShip上运行CI(testing)通过OK。

但是,当我从Travis或CodeShip下载软件包,并尝试运行npm脚本(例如npm install或npm start)时,出现依赖性错误。

如果我完全删除node_modules文件夹并再次运行npm安装,一切正常。

NPM INSTALL

gulp minify-sdk && gulp setup-auto module.js:339 throw err; ^ Error: Cannot find module 'gulp-util' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Object.<anonymous> (/Users/simon/latest/node_modules/.bin/gulp:4:13) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Function.Module.runMain (module.js:467:10) npm ERR! Darwin 15.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! node v4.2.1 npm ERR! npm v2.14.7 npm ERR! code ELIFECYCLE npm ERR! app@0.0.1 postinstall: `gulp minify-sdk && gulp setup-auto` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the app@0.0.1 postinstall script 'gulp minify-sdk && gulp setup-auto'. npm ERR! This is most likely a problem with the app package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! gulp minify-sdk && gulp setup-auto npm ERR! You can get their info via: npm ERR! npm owner ls app npm ERR! There is likely additional logging output above. 

NPM START

 nodemon app.js module.js:339 throw err; ^ Error: Cannot find module '../lib/cli' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Object.<anonymous> (/Users/simon/latest/node_modules/.bin/nodemon:3:11) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Function.Module.runMain (module.js:467:10) npm ERR! Darwin 15.4.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" npm ERR! node v4.2.1 npm ERR! npm v2.14.7 npm ERR! code ELIFECYCLE npm ERR! app@0.0.1 start: `nodemon app.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the app@0.0.1 start script 'nodemon app.js'. npm ERR! This is most likely a problem with the app package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! nodemon app.js npm ERR! You can get their info via: npm ERR! npm owner ls app npm ERR! There is likely additional logging output above. 

任何想法为什么node_module文件夹被损坏或configuration错误?