• Not Answered

Error on Build: Using MSBuild, TeamCity and Gulp

I have run into a wall with the following error while trying to do a build on TeamCity:

Step 5/6: Create Files Package (Gulp) (4s)
[15:58:18][Step 5/6] Executing C:\TeamCity\buildAgent\work\b1f1d2d452570812\node_modules\.bin\gulp.cmd via wrapping shell script
[15:58:18][Step 5/6] Starting: cmd /c C:\TeamCity\buildAgent\work\b1f1d2d452570812\node_modules\.bin\gulp.cmd --no-color --gulpfile C:\TeamCity\buildAgent\work\b1f1d2d452570812\gulpfile-ci.js --teamcity.properties.all=C:\TeamCity\buildAgent\temp\agentTmp\teamcity8316780913488459053.json --teamcity.properties=C:\TeamCity\buildAgent\temp\agentTmp\teamcity550029580555281687.json CI-Do-MagicForDG
[15:58:18][Step 5/6] in directory: C:\TeamCity\buildAgent\work\b1f1d2d452570812
[15:58:22][Step 5/6] module.js:549
[15:58:22][Step 5/6] throw err;
[15:58:22][Step 5/6] ^
[15:58:22][Step 5/6]
[15:58:22][Step 5/6] Error: Cannot find module 'lodash'
[15:58:22][Step 5/6] at Function.Module._resolveFilename (module.js:547:15)
[15:58:22][Step 5/6] at Function.Module._load (module.js:474:25)
[15:58:22][Step 5/6] at Module.require (module.js:596:17)
[15:58:22][Step 5/6] at require (internal/module.js:11:18)
[15:58:22][Step 5/6] at Object.<anonymous> (C:\TeamCity\buildAgent\work\b1f1d2d452570812\node_modules\globule\lib\globule.js:14:9)
[15:58:22][Step 5/6] at Module._compile (module.js:652:30)
[15:58:22][Step 5/6] at Object.Module._extensions..js (module.js:663:10)
[15:58:22][Step 5/6] at Module.load (module.js:565:32)
[15:58:22][Step 5/6] at tryModuleLoad (module.js:505:12)
[15:58:22][Step 5/6] at Function.Module._load (module.js:497:3)
[15:58:22][Step 5/6] Process exited with code 1
[15:58:22][Step 5/6] Process exited with code 1
[15:58:22][Step 5/6] Step Create Files Package (Gulp) failed

I have Googled and read and tried the many proposed ideas. Nothing has worked for me.

 

-George

5 Replies

  • TeamCity is setup to pull the node_modules and Gulp settings from the source repository that is dumped into a temporary build folder on the TeamCity server. The lodash module is there.
  • In reply to George Stout:

    RDP on team city server and try to run the npm install or your gulp command manually from the teamcity build folder. You may get a different error, try to resolve that. It could be a reason that a dependency is missing or it has invalid version number.
  • Potentially check and see if the lodash module is installed globally and is conflicting with your team city project. If it is installed globally that may be affecting your specific project version.

    You can check what node modules are installed globally by logging onto your team city server and running the following from a command prompt:

    npm -g list

    if you want the output in JSON format, which can be easier to read, use the following:

    npm -g list --json
  • We ran npm install on our teamcity build folder but still get same error. What else could it be?
  • We are good now.Going a different direction.