node.js - node long path module names fail teamcity build -


we trying install node in our asp.net mvc project how ever when checked our code in fail builds in team city. due known issue of long module path names npm uses.

here log:

    [08:07:46]checking changes [08:07:49]publishing internal artifacts (5s) [08:07:54][publishing internal artifacts] sending build.start.properties.gz file [08:07:49]clearing temporary directory: c:\teamcity\buildagent3\temp\buildtmp [08:07:54]clean build enabled: removing old files c:\teamcity\buildagent3\work\57c6a27fa330ee2f [08:07:54]checkout directory: c:\teamcity\buildagent3\work\57c6a27fa330ee2f [08:07:54]updating sources: agent side checkout (15s) [08:07:54][updating sources] perform clean checkout. reason: checkout directory empty or doesn't exist [08:07:54][updating sources] cleaning c:\teamcity\buildagent3\work\57c6a27fa330ee2f [08:07:54][updating sources] vcs root: git - tempsearch (15s) [08:07:54][vcs root: git - tempsearch] revision: cf23c64dd32077edeb1b96a85d1be104bd127044 [08:07:54][vcs root: git - tempsearch] cleaning c:\teamcity\buildagent3\work\57c6a27fa330ee2f [08:07:54][vcs root: git - tempsearch] .git directory missing in 'c:\teamcity\buildagent3\work\57c6a27fa330ee2f'. running 'git init'... [08:08:05][vcs root: git - tempsearch] checking out branch refs/heads/develop in git - tempsearch in c:\teamcity\buildagent3\work\57c6a27fa330ee2f revision cf23c64dd32077edeb1b96a85d1be104bd127044 [08:08:10] [updating sources] failed perform checkout on agent: '"c:\program files (x86)\git\bin\git.exe" checkout -q -f develop' command failed. stderr: fatal: cannot create directory @ 'node_modules/grunt-contrib-jasmine/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion': no such file or directory [08:08:10]publishing internal artifacts [08:08:10][publishing internal artifacts] sending build.finish.properties.gz file [08:08:10]build failed start. artifacts not published build [08:08:10]build finished 

the error:

    error while applying patch: failed perform checkout on agent: '"c:\program files (x86)\git\bin\git.exe" checkout -q -f develop' command failed. stderr: fatal: cannot create directory @ 'node_modules/grunt-contrib-jasmine/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion': no such file or director 

are there long term solutions problem?

to respond of comment. have bit more space here ;).

it depends bit on exact situation how solve this. how have set things @ company here:

setup developing

some node modules have installed globally, each developer have install globally (grunt-cli, karma, bower example). other node_modules can/have installed locally add package.json file like:

      "devdependencies": {             "grunt": "~0.4.2",             "grunt-karma": "~0.7.3",             "karma-jasmine": "~0.2.0",             "karma-firefox-launcher": "~0.1",             "karma-chrome-launcher": "~0.1",             "karma-phantomjs-launcher": "~0.1",             "grunt-contrib-clean": "~0.4.1",             "grunt-contrib-copy": "~0.4.1",             "grunt-contrib-jshint": "~0.10.0",             "grunt-contrib-concat": "~0.3.0",             "grunt-contrib-watch": "~0.5.3",             "grunt-contrib-uglify": "~0.4.0",             "grunt-contrib-less": "~0.9.0"        } 

more information package.json can find here http://browsenpm.org/package.json. note bower has installed globally , locally (if using it).

this means every develop has global install of node_modules use once. might want choose specific version of each node_module using same version. can install global modules this:

~ npm install grunt-cli karma bower -g

you add package.json file local modules base structure of project, , add git repository. each developer checkout receive file. have install of local modules using same tools:

~ npm install

this means local modules don't have part of git repo, find practice since isn't source code. solves problem of git not supporting long node_modules paths.

if have build process node setup doesn't change anymore, npm_modules installed both globally , locally won't have change. if change tools, each develop have redo npm install. me hasn't happened yet.

build server

you have install node , these global modules on build server have access them during build. have done create .bat file gets executed during build includes 'npm install' resolve node_modules during build well. way have access latest tools during build.

multiple projects if have multiple projects use same local node_modules build, should take @ grunt-collections. can create 1 central location node_modules way, developers have install them once projects there post here:

centralise node_modules in project subproject

hope clears things ups


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -