Can't npm install 'git url' packages via a post-receive hook #2597

Closed
grahamb opened this Issue Jul 3, 2012 · 9 comments

Comments

Projects
None yet
4 participants

grahamb commented Jul 3, 2012

I have a node app where two of its dependencies are defined using git urls (as described in http://npmjs.org/doc/json.html). The dependencies block of my package.json file looks like this:

"dependencies": {
    "express": "git://github.com/sfu/express.git#basepath-patch-2.x",
    "ejs": "0.7.1",
    "moment": "1.5.0",
    "schema": "0.2.0",
    "cas-sfu": "1.0.x",
    "gzippo": "0.1.4",
    "connect-redis": "1.3.x",
    "redis": "0.7.x",
    "winston": "0.6.x",
    "winston-syslog": "git://github.com/sfu/winston-syslog.git",
    "winston-mail": "0.2.x",
    "graphite": "0.0.6",
    "less": "1.3.0",
    "uglify-js": "1.3.2",
    "jshint": "0.7.x"
}

Both git-url dependencies are public repos on GitHub.

A normal npm install works fine with this config, both on my dev machine (OS X 10.7.4, node 0.6.19, npm 1.1.14) and my production server (RHEL 6.something, node 0.6.19, npm 1.1.28).

As part of a deploy process I have a git post-receive hook that checks out the repo to a temp dir and attempts to run npm install to fetch all the dependencies. Initially I was running npm install as part of a jake task (which works when run manually (jake install-npm-deps) but I've changed it to just calling npm install from within the post-receive hook directly. Both fail when run as part of the post-receive hook when either or both of the 'git url' dependencies are present in package.json.

If I remove both 'git url' dependencies from package.json, the post-receive hook runs fine. Again, npm install works just fine when invoked manually on the production server, it's just failing as part of a post-receive hook script.

Output from the post-receive hook:

Counting objects: 2228, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2112/2112), done.
Writing objects: 100% (2228/2228), 2.10 MiB, done.
Total 2228 (delta 914), reused 0 (delta 0)
remote: checking out files to /tmp/roadconditions
remote: Switched to branch 'wtf'
remote: /tmp/roadconditions
remote: npm http GET https://registry.npmjs.org/ejs/0.7.1
remote: npm http GET https://registry.npmjs.org/schema/0.2.0
remote: npm http GET https://registry.npmjs.org/cas-sfu
remote: npm http GET https://registry.npmjs.org/gzippo/0.1.4
remote: npm http GET https://registry.npmjs.org/connect-redis
remote: npm http GET https://registry.npmjs.org/redis
remote: npm http GET https://registry.npmjs.org/moment/1.5.0
remote: npm http GET https://registry.npmjs.org/winston-mail
remote: npm http GET https://registry.npmjs.org/graphite/0.0.6
remote: npm http GET https://registry.npmjs.org/less/1.3.0
remote: npm http GET https://registry.npmjs.org/uglify-js/1.3.2
remote: npm http GET https://registry.npmjs.org/winston
remote: npm http GET https://registry.npmjs.org/jshint
remote: npm http 304 https://registry.npmjs.org/ejs/0.7.1
remote: npm http 304 https://registry.npmjs.org/schema/0.2.0
remote: npm http 304 https://registry.npmjs.org/gzippo/0.1.4
remote: npm http 304 https://registry.npmjs.org/cas-sfu
remote: npm ERR! git checkout master fatal: Not a git repository: '.'
remote: npm ERR! Error: `git "checkout" "master"` failed with 128
remote: npm ERR!     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/exec.js:56:20)
remote: npm ERR!     at ChildProcess.emit (events.js:70:17)
remote: npm ERR!     at maybeExit (child_process.js:362:16)
remote: npm ERR!     at Socket.<anonymous> (child_process.js:467:7)
remote: npm ERR!     at Socket.emit (events.js:67:17)
remote: npm ERR!     at Array.0 (net.js:335:10)
remote: npm ERR!     at EventEmitter._tickCallback (node.js:190:38)
remote: npm ERR!  [Error: `git "checkout" "master"` failed with 128]
remote: npm ERR! You may report this log at:
remote: npm ERR!     <http://github.com/isaacs/npm/issues>
remote: npm ERR! or email it to:
remote: npm ERR!     <npm-@googlegroups.com>
remote: 
remote: npm ERR! System Linux 2.6.32-220.17.1.el6.x86_64
remote: npm ERR! command "node" "/usr/local/bin/npm" "install"
remote: npm ERR! cwd /tmp/roadconditions
remote: npm ERR! node -v v0.6.19
remote: npm ERR! npm -v 1.1.28
remote: npm ERR! message `git "checkout" "master"` failed with 128
remote: npm http 304 https://registry.npmjs.org/connect-redis
remote: npm http 304 https://registry.npmjs.org/redis
remote: npm http 304 https://registry.npmjs.org/moment/1.5.0
remote: npm http 304 https://registry.npmjs.org/winston-mail
remote: npm http 304 https://registry.npmjs.org/graphite/0.0.6
remote: npm http 304 https://registry.npmjs.org/less/1.3.0
remote: npm http 304 https://registry.npmjs.org/uglify-js/1.3.2
remote: npm http 304 https://registry.npmjs.org/winston
remote: npm http 304 https://registry.npmjs.org/jshint
remote: npm ERR! git checkout basepath-patch-2.x fatal: Not a git repository: '.'
remote: npm ERR! 
remote: npm ERR! Additional logging details can be found in:
remote: npm ERR!     /tmp/roadconditions/npm-debug.log
remote: npm ERR! not ok code undefined
remote: npm ERR! not ok code 1
remote: aborting and cleaning up

Contents of npm-debug.log after the failure:

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
2 info using npm@1.1.28
3 info using node@v0.6.19
4 verbose config file /home/nodeuser/.npmrc
5 verbose config file /usr/local/etc/npmrc
6 verbose config file /usr/local/lib/node_modules/npm/npmrc
7 verbose read json /tmp/roadconditions/package.json
8 verbose readDependencies using package.json deps
9 verbose install where, deps [ '/tmp/roadconditions',
9 verbose install   [ 'express',
9 verbose install     'ejs',
9 verbose install     'moment',
9 verbose install     'schema',
9 verbose install     'cas-sfu',
9 verbose install     'gzippo',
9 verbose install     'connect-redis',
9 verbose install     'redis',
9 verbose install     'winston',
9 verbose install     'winston-syslog',
9 verbose install     'winston-mail',
9 verbose install     'graphite',
9 verbose install     'less',
9 verbose install     'uglify-js',
9 verbose install     'jshint' ] ]
10 verbose from cache /tmp/roadconditions/package.json
11 info preinstall roadconditions@1.0.0
12 verbose read json /tmp/roadconditions/node_modules/winston-syslog/package.json
13 verbose read json /tmp/roadconditions/node_modules/express/package.json
14 verbose from cache /tmp/roadconditions/package.json
15 verbose readDependencies using package.json deps
16 verbose from cache /tmp/roadconditions/node_modules/winston-syslog/package.json
17 verbose from cache /tmp/roadconditions/node_modules/express/package.json
18 verbose cache add [ 'express@git://github.com/sfu/express.git#basepath-patch-2.x',
18 verbose cache add   null ]
19 silly cache add name=undefined spec="express@git://github.com/sfu/express.git#basepath-patch-2.x" args=["express@git://github.com/sfu/express.git#basepath-patch-2.x",null]
20 verbose parsed url { hash: '#basepath-patch-2.x',
20 verbose parsed url   pathname: 'express@git://github.com/sfu/express.git',
20 verbose parsed url   path: 'express@git://github.com/sfu/express.git',
20 verbose parsed url   href: 'express@git://github.com/sfu/express.git#basepath-patch-2.x' }
21 silly cache add name="express" spec="git://github.com/sfu/express.git#basepath-patch-2.x" args=["express","git://github.com/sfu/express.git#basepath-patch-2.x"]
22 verbose parsed url { protocol: 'git:',
22 verbose parsed url   slashes: true,
22 verbose parsed url   host: 'github.com',
22 verbose parsed url   hostname: 'github.com',
22 verbose parsed url   href: 'git://github.com/sfu/express.git#basepath-patch-2.x',
22 verbose parsed url   hash: '#basepath-patch-2.x',
22 verbose parsed url   pathname: '/sfu/express.git',
22 verbose parsed url   path: '/sfu/express.git' }
23 verbose addRemoteGit [ 'git://github.com/sfu/express.git', 'basepath-patch-2.x' ]
24 verbose cache add [ 'ejs@0.7.1', null ]
25 silly cache add name=undefined spec="ejs@0.7.1" args=["ejs@0.7.1",null]
26 verbose parsed url { pathname: 'ejs@0.7.1', path: 'ejs@0.7.1', href: 'ejs@0.7.1' }
27 silly cache add name="ejs" spec="0.7.1" args=["ejs","0.7.1"]
28 verbose parsed url { pathname: '0.7.1', path: '0.7.1', href: '0.7.1' }
29 verbose addNamed [ 'ejs', '0.7.1' ]
30 verbose addNamed [ '0.7.1', '0.7.1' ]
31 silly exec git "clone" "git://github.com/sfu/express.git" "/home/nodeuser/tmp/npm-1341340138128/1341340138128-0.2805449762381613"
32 silly git,clone,git://github.com/sfu/express.git,/home/nodeuser/tmp/npm-1341340138128/1341340138128-0.2805449762381613, spawning
33 verbose cache add [ 'moment@1.5.0', null ]
34 silly cache add name=undefined spec="moment@1.5.0" args=["moment@1.5.0",null]
35 verbose parsed url { pathname: 'moment@1.5.0',
35 verbose parsed url   path: 'moment@1.5.0',
35 verbose parsed url   href: 'moment@1.5.0' }
36 silly cache add name="moment" spec="1.5.0" args=["moment","1.5.0"]
37 verbose parsed url { pathname: '1.5.0', path: '1.5.0', href: '1.5.0' }
38 verbose addNamed [ 'moment', '1.5.0' ]
39 verbose addNamed [ '1.5.0', '1.5.0' ]
40 verbose cache add [ 'schema@0.2.0', null ]
41 silly cache add name=undefined spec="schema@0.2.0" args=["schema@0.2.0",null]
42 verbose parsed url { pathname: 'schema@0.2.0',
42 verbose parsed url   path: 'schema@0.2.0',
42 verbose parsed url   href: 'schema@0.2.0' }
43 silly cache add name="schema" spec="0.2.0" args=["schema","0.2.0"]
44 verbose parsed url { pathname: '0.2.0', path: '0.2.0', href: '0.2.0' }
45 verbose addNamed [ 'schema', '0.2.0' ]
46 verbose addNamed [ '0.2.0', '0.2.0' ]
47 verbose cache add [ 'cas-sfu@1.0.x', null ]
48 silly cache add name=undefined spec="cas-sfu@1.0.x" args=["cas-sfu@1.0.x",null]
49 verbose parsed url { pathname: 'cas-sfu@1.0.x',
49 verbose parsed url   path: 'cas-sfu@1.0.x',
49 verbose parsed url   href: 'cas-sfu@1.0.x' }
50 silly cache add name="cas-sfu" spec="1.0.x" args=["cas-sfu","1.0.x"]
51 verbose parsed url { pathname: '1.0.x', path: '1.0.x', href: '1.0.x' }
52 verbose addNamed [ 'cas-sfu', '1.0.x' ]
53 verbose addNamed [ null, '>=1.0.0- <1.1.0-' ]
54 silly addNameRange { name: 'cas-sfu', range: '>=1.0.0- <1.1.0-', hasData: false }
55 verbose cache add [ 'gzippo@0.1.4', null ]
56 silly cache add name=undefined spec="gzippo@0.1.4" args=["gzippo@0.1.4",null]
57 verbose parsed url { pathname: 'gzippo@0.1.4',
57 verbose parsed url   path: 'gzippo@0.1.4',
57 verbose parsed url   href: 'gzippo@0.1.4' }
58 silly cache add name="gzippo" spec="0.1.4" args=["gzippo","0.1.4"]
59 verbose parsed url { pathname: '0.1.4', path: '0.1.4', href: '0.1.4' }
60 verbose addNamed [ 'gzippo', '0.1.4' ]
61 verbose addNamed [ '0.1.4', '0.1.4' ]
62 verbose cache add [ 'connect-redis@1.3.x', null ]
63 silly cache add name=undefined spec="connect-redis@1.3.x" args=["connect-redis@1.3.x",null]
64 verbose parsed url { pathname: 'connect-redis@1.3.x',
64 verbose parsed url   path: 'connect-redis@1.3.x',
64 verbose parsed url   href: 'connect-redis@1.3.x' }
65 silly cache add name="connect-redis" spec="1.3.x" args=["connect-redis","1.3.x"]
66 verbose parsed url { pathname: '1.3.x', path: '1.3.x', href: '1.3.x' }
67 verbose addNamed [ 'connect-redis', '1.3.x' ]
68 verbose addNamed [ null, '>=1.3.0- <1.4.0-' ]
69 silly addNameRange { name: 'connect-redis',
69 silly addNameRange   range: '>=1.3.0- <1.4.0-',
69 silly addNameRange   hasData: false }
70 verbose cache add [ 'redis@0.7.x', null ]
71 silly cache add name=undefined spec="redis@0.7.x" args=["redis@0.7.x",null]
72 verbose parsed url { pathname: 'redis@0.7.x',
72 verbose parsed url   path: 'redis@0.7.x',
72 verbose parsed url   href: 'redis@0.7.x' }
73 silly cache add name="redis" spec="0.7.x" args=["redis","0.7.x"]
74 verbose parsed url { pathname: '0.7.x', path: '0.7.x', href: '0.7.x' }
75 verbose addNamed [ 'redis', '0.7.x' ]
76 verbose addNamed [ null, '>=0.7.0- <0.8.0-' ]
77 silly addNameRange { name: 'redis', range: '>=0.7.0- <0.8.0-', hasData: false }
78 verbose cache add [ 'winston@0.6.x', null ]
79 silly cache add name=undefined spec="winston@0.6.x" args=["winston@0.6.x",null]
80 verbose parsed url { pathname: 'winston@0.6.x',
80 verbose parsed url   path: 'winston@0.6.x',
80 verbose parsed url   href: 'winston@0.6.x' }
81 silly cache add name="winston" spec="0.6.x" args=["winston","0.6.x"]
82 verbose parsed url { pathname: '0.6.x', path: '0.6.x', href: '0.6.x' }
83 verbose addNamed [ 'winston', '0.6.x' ]
84 verbose addNamed [ null, '>=0.6.0- <0.7.0-' ]
85 silly addNameRange { name: 'winston', range: '>=0.6.0- <0.7.0-', hasData: false }
86 verbose url raw ejs/0.7.1
87 verbose url resolving [ 'https://registry.npmjs.org/', './ejs/0.7.1' ]
88 verbose url resolved https://registry.npmjs.org/ejs/0.7.1
89 verbose etag "1M6CY0RCJ7Z9RLTPGDIUV1FJB"
90 http GET https://registry.npmjs.org/ejs/0.7.1
91 verbose url raw schema/0.2.0
92 verbose url resolving [ 'https://registry.npmjs.org/', './schema/0.2.0' ]
93 verbose url resolved https://registry.npmjs.org/schema/0.2.0
94 verbose etag "7WCC6VHBXO93LN47PPYYBPTDB"
95 http GET https://registry.npmjs.org/schema/0.2.0
96 verbose cache add [ 'winston-syslog@git://github.com/sfu/winston-syslog.git',
96 verbose cache add   null ]
97 silly cache add name=undefined spec="winston-syslog@git://github.com/sfu/winston-syslog.git" args=["winston-syslog@git://github.com/sfu/winston-syslog.git",null]
98 verbose parsed url { pathname: 'winston-syslog@git://github.com/sfu/winston-syslog.git',
98 verbose parsed url   path: 'winston-syslog@git://github.com/sfu/winston-syslog.git',
98 verbose parsed url   href: 'winston-syslog@git://github.com/sfu/winston-syslog.git' }
99 silly cache add name="winston-syslog" spec="git://github.com/sfu/winston-syslog.git" args=["winston-syslog","git://github.com/sfu/winston-syslog.git"]
100 verbose parsed url { protocol: 'git:',
100 verbose parsed url   slashes: true,
100 verbose parsed url   host: 'github.com',
100 verbose parsed url   hostname: 'github.com',
100 verbose parsed url   href: 'git://github.com/sfu/winston-syslog.git',
100 verbose parsed url   pathname: '/sfu/winston-syslog.git',
100 verbose parsed url   path: '/sfu/winston-syslog.git' }
101 verbose addRemoteGit [ 'git://github.com/sfu/winston-syslog.git', 'master' ]
102 verbose cache add [ 'winston-mail@0.2.x', null ]
103 silly cache add name=undefined spec="winston-mail@0.2.x" args=["winston-mail@0.2.x",null]
104 verbose parsed url { pathname: 'winston-mail@0.2.x',
104 verbose parsed url   path: 'winston-mail@0.2.x',
104 verbose parsed url   href: 'winston-mail@0.2.x' }
105 silly cache add name="winston-mail" spec="0.2.x" args=["winston-mail","0.2.x"]
106 verbose parsed url { pathname: '0.2.x', path: '0.2.x', href: '0.2.x' }
107 verbose addNamed [ 'winston-mail', '0.2.x' ]
108 verbose addNamed [ null, '>=0.2.0- <0.3.0-' ]
109 silly addNameRange { name: 'winston-mail',
109 silly addNameRange   range: '>=0.2.0- <0.3.0-',
109 silly addNameRange   hasData: false }
110 verbose cache add [ 'graphite@0.0.6', null ]
111 silly cache add name=undefined spec="graphite@0.0.6" args=["graphite@0.0.6",null]
112 verbose parsed url { pathname: 'graphite@0.0.6',
112 verbose parsed url   path: 'graphite@0.0.6',
112 verbose parsed url   href: 'graphite@0.0.6' }
113 silly cache add name="graphite" spec="0.0.6" args=["graphite","0.0.6"]
114 verbose parsed url { pathname: '0.0.6', path: '0.0.6', href: '0.0.6' }
115 verbose addNamed [ 'graphite', '0.0.6' ]
116 verbose addNamed [ '0.0.6', '0.0.6' ]
117 verbose cache add [ 'less@1.3.0', null ]
118 silly cache add name=undefined spec="less@1.3.0" args=["less@1.3.0",null]
119 verbose parsed url { pathname: 'less@1.3.0',
119 verbose parsed url   path: 'less@1.3.0',
119 verbose parsed url   href: 'less@1.3.0' }
120 silly cache add name="less" spec="1.3.0" args=["less","1.3.0"]
121 verbose parsed url { pathname: '1.3.0', path: '1.3.0', href: '1.3.0' }
122 verbose addNamed [ 'less', '1.3.0' ]
123 verbose addNamed [ '1.3.0', '1.3.0' ]
124 verbose cache add [ 'uglify-js@1.3.2', null ]
125 silly cache add name=undefined spec="uglify-js@1.3.2" args=["uglify-js@1.3.2",null]
126 verbose parsed url { pathname: 'uglify-js@1.3.2',
126 verbose parsed url   path: 'uglify-js@1.3.2',
126 verbose parsed url   href: 'uglify-js@1.3.2' }
127 silly cache add name="uglify-js" spec="1.3.2" args=["uglify-js","1.3.2"]
128 verbose parsed url { pathname: '1.3.2', path: '1.3.2', href: '1.3.2' }
129 verbose addNamed [ 'uglify-js', '1.3.2' ]
130 verbose addNamed [ '1.3.2', '1.3.2' ]
131 verbose cache add [ 'jshint@0.7.x', null ]
132 silly cache add name=undefined spec="jshint@0.7.x" args=["jshint@0.7.x",null]
133 verbose parsed url { pathname: 'jshint@0.7.x',
133 verbose parsed url   path: 'jshint@0.7.x',
133 verbose parsed url   href: 'jshint@0.7.x' }
134 silly cache add name="jshint" spec="0.7.x" args=["jshint","0.7.x"]
135 verbose parsed url { pathname: '0.7.x', path: '0.7.x', href: '0.7.x' }
136 verbose addNamed [ 'jshint', '0.7.x' ]
137 verbose addNamed [ null, '>=0.7.0- <0.8.0-' ]
138 silly addNameRange { name: 'jshint', range: '>=0.7.0- <0.8.0-', hasData: false }
139 verbose url raw cas-sfu
140 verbose url resolving [ 'https://registry.npmjs.org/', './cas-sfu' ]
141 verbose url resolved https://registry.npmjs.org/cas-sfu
142 verbose etag "99DYR60N980J1LHQ2YDKZU66V"
143 http GET https://registry.npmjs.org/cas-sfu
144 verbose url raw gzippo/0.1.4
145 verbose url resolving [ 'https://registry.npmjs.org/', './gzippo/0.1.4' ]
146 verbose url resolved https://registry.npmjs.org/gzippo/0.1.4
147 verbose etag "8AH736G8SG7V0SJ4ZWFW4LLN6"
148 http GET https://registry.npmjs.org/gzippo/0.1.4
149 silly exec git "clone" "git://github.com/sfu/winston-syslog.git" "/home/nodeuser/tmp/npm-1341340138128/1341340138150-0.1658125810790807"
150 silly git,clone,git://github.com/sfu/winston-syslog.git,/home/nodeuser/tmp/npm-1341340138128/1341340138150-0.1658125810790807, spawning
151 verbose url raw connect-redis
152 verbose url resolving [ 'https://registry.npmjs.org/', './connect-redis' ]
153 verbose url resolved https://registry.npmjs.org/connect-redis
154 verbose etag "29B67RT4VZ1NIVA403P5KYINK"
155 http GET https://registry.npmjs.org/connect-redis
156 verbose url raw redis
157 verbose url resolving [ 'https://registry.npmjs.org/', './redis' ]
158 verbose url resolved https://registry.npmjs.org/redis
159 verbose etag "5OTNNKRNPH46HD5IQAQ5YBVFI"
160 http GET https://registry.npmjs.org/redis
161 verbose url raw moment/1.5.0
162 verbose url resolving [ 'https://registry.npmjs.org/', './moment/1.5.0' ]
163 verbose url resolved https://registry.npmjs.org/moment/1.5.0
164 verbose etag "DQW8EVRL9BC7C2WBL1P8QPXCN"
165 http GET https://registry.npmjs.org/moment/1.5.0
166 verbose url raw winston-mail
167 verbose url resolving [ 'https://registry.npmjs.org/', './winston-mail' ]
168 verbose url resolved https://registry.npmjs.org/winston-mail
169 verbose etag "AF8BK942NM2XSCV5L8YU1N75C"
170 http GET https://registry.npmjs.org/winston-mail
171 verbose url raw graphite/0.0.6
172 verbose url resolving [ 'https://registry.npmjs.org/', './graphite/0.0.6' ]
173 verbose url resolved https://registry.npmjs.org/graphite/0.0.6
174 verbose etag "AH3338SDGBYCIW2ZREBVEIIIU"
175 http GET https://registry.npmjs.org/graphite/0.0.6
176 verbose url raw less/1.3.0
177 verbose url resolving [ 'https://registry.npmjs.org/', './less/1.3.0' ]
178 verbose url resolved https://registry.npmjs.org/less/1.3.0
179 verbose etag "363ARQ3C3X4HIVHR27S78QPW8"
180 http GET https://registry.npmjs.org/less/1.3.0
181 verbose url raw uglify-js/1.3.2
182 verbose url resolving [ 'https://registry.npmjs.org/', './uglify-js/1.3.2' ]
183 verbose url resolved https://registry.npmjs.org/uglify-js/1.3.2
184 verbose etag "EMYPMKC1JAZ5J7F3INLCWMOM9"
185 http GET https://registry.npmjs.org/uglify-js/1.3.2
186 verbose url raw winston
187 verbose url resolving [ 'https://registry.npmjs.org/', './winston' ]
188 verbose url resolved https://registry.npmjs.org/winston
189 verbose etag "AR6GTVR5IM3AGRKOO5HRXCRCV"
190 http GET https://registry.npmjs.org/winston
191 verbose url raw jshint
192 verbose url resolving [ 'https://registry.npmjs.org/', './jshint' ]
193 verbose url resolved https://registry.npmjs.org/jshint
194 verbose etag "3RW595B9ECBBC45QJCVF35NNM"
195 http GET https://registry.npmjs.org/jshint
196 http 304 https://registry.npmjs.org/ejs/0.7.1
197 silly registry.get cb [ 304,
197 silly registry.get   { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
197 silly registry.get     etag: '"1M6CY0RCJ7Z9RLTPGDIUV1FJB"',
197 silly registry.get     date: 'Tue, 03 Jul 2012 18:28:58 GMT',
197 silly registry.get     'content-length': '0' } ]
198 verbose etag ejs/0.7.1 from cache
199 verbose read json /home/nodeuser/.npm/ejs/0.7.1/package/package.json
200 http 304 https://registry.npmjs.org/schema/0.2.0
201 silly registry.get cb [ 304,
201 silly registry.get   { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
201 silly registry.get     etag: '"7WCC6VHBXO93LN47PPYYBPTDB"',
201 silly registry.get     date: 'Tue, 03 Jul 2012 18:28:58 GMT',
201 silly registry.get     'content-length': '0' } ]
202 verbose etag schema/0.2.0 from cache
203 verbose read json /home/nodeuser/.npm/schema/0.2.0/package/package.json
204 http 304 https://registry.npmjs.org/gzippo/0.1.4
205 silly registry.get cb [ 304,
205 silly registry.get   { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
205 silly registry.get     etag: '"8AH736G8SG7V0SJ4ZWFW4LLN6"',
205 silly registry.get     date: 'Tue, 03 Jul 2012 18:28:58 GMT',
205 silly registry.get     'content-length': '0' } ]
206 verbose etag gzippo/0.1.4 from cache
207 verbose read json /home/nodeuser/.npm/gzippo/0.1.4/package/package.json
208 http 304 https://registry.npmjs.org/cas-sfu
209 silly registry.get cb [ 304,
209 silly registry.get   { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
209 silly registry.get     etag: '"99DYR60N980J1LHQ2YDKZU66V"',
209 silly registry.get     date: 'Tue, 03 Jul 2012 18:28:58 GMT',
209 silly registry.get     'content-length': '0' } ]
210 verbose etag cas-sfu from cache
211 silly addNameRange number 2 { name: 'cas-sfu', range: '>=1.0.0- <1.1.0-', hasData: true }
212 silly addNameRange versions [ 'cas-sfu',
212 silly addNameRange   [ '1.0.0', '1.0.1', '1.0.2', '1.0.3', '1.0.4', '1.0.5' ] ]
213 verbose read json /home/nodeuser/.npm/cas-sfu/1.0.5/package/package.json
214 verbose git clone git://github.com/sfu/winston-syslog.git Cloning into '/home/nodeuser/tmp/npm-1341340138128/1341340138150-0.1658125810790807'...
215 silly exec git "checkout" "master"
216 silly git,checkout,master,/home/nodeuser/tmp/npm-1341340138128/1341340138150-0.1658125810790807 spawning
217 error git checkout master fatal: Not a git repository: '.'
218 error Error: `git "checkout" "master"` failed with 128
218 error     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/exec.js:56:20)
218 error     at ChildProcess.emit (events.js:70:17)
218 error     at maybeExit (child_process.js:362:16)
218 error     at Socket.<anonymous> (child_process.js:467:7)
218 error     at Socket.emit (events.js:67:17)
218 error     at Array.0 (net.js:335:10)
218 error     at EventEmitter._tickCallback (node.js:190:38)
218 error  [Error: `git "checkout" "master"` failed with 128]
219 error You may report this log at:
219 error     <http://github.com/isaacs/npm/issues>
219 error or email it to:
219 error     <npm-@googlegroups.com>
220 error System Linux 2.6.32-220.17.1.el6.x86_64
221 error command "node" "/usr/local/bin/npm" "install"
222 error cwd /tmp/roadconditions
223 error node -v v0.6.19
224 error npm -v 1.1.28
225 error message `git "checkout" "master"` failed with 128
Owner

isaacs commented Jul 5, 2012

Is /home/nodeuser/tmp/npm-1341340138128/1341340138150-0.1658125810790807 a git repo?

Are you clearing out the GIT_DIR and other git-related environment variables before running npm install?

grahamb commented Jul 5, 2012

It should be a git repo, if it's doing a clone of git://github.com/sfu/express.git#basepath-patch-2.x. I'm not explicitly clearing any environment variables, though it's possible that the post-receive hook isn't reading them.

I was able to work around the problem by specifying a tarball URL instead.

Contributor

hunterloftis commented Jul 12, 2012

Having the exact same issue... not using any urls directly in package.json but I suspect some of our required modules are, so we can't work around it:

remote: npm http 304 https://registry.npmjs.org/xmlhttprequest/1.2.2
remote: npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
remote: npm http 304 https://registry.npmjs.org/ws
remote: npm ERR! git checkout master fatal: Not a git repository: '.'
remote: 
remote: npm ERR! Error: `git "checkout" "master"` failed with 128
remote: npm ERR!     at ChildProcess.<anonymous> (/home/prod_web1/local/lib/node_modules/npm/lib/utils/exec.js:58:20)
remote: npm ERR!     at ChildProcess.emit (events.js:70:17)
remote: npm ERR!     at maybeExit (child_process.js:362:16)
remote: npm ERR!     at Socket.<anonymous> (child_process.js:467:7)
remote: npm ERR!     at Socket.emit (events.js:67:17)
remote: npm ERR!     at Array.<anonymous> (net.js:335:10)
remote: npm ERR!     at EventEmitter._tickCallback (node.js:190:38)
remote: npm ERR! You may report this log at:
remote: npm ERR!     <http://github.com/isaacs/npm/issues>
remote: npm ERR! or email it to:
remote: npm ERR!     <npm-@googlegroups.com>
remote: npm ERR! 
remote: npm ERR! System Linux 3.4.2-x86_64-linode25
remote: npm ERR! command "node" "/home/prod_web1/local/bin/npm" "install"
remote: npm ERR! cwd /home/prod_web1/slugs/96e9b06d2094d4b5a006c342be7ca706e8fc0954
remote: npm ERR! node -v v0.6.19
remote: npm ERR! npm -v 1.1.24
remote: npm ERR! message `git "checkout" "master"` failed with 128
remote: npm http GET https://registry.npmjs.org/zeparser/0.0.5
remote: npm http 304 https://registry.npmjs.org/zeparser/0.0.5
Contributor

hunterloftis commented Jul 13, 2012

Did some more research into this, and provided the full hook as well as ENV at the time of execution:

https://gist.github.com/3100224

Contributor

hunterloftis commented Jul 13, 2012

Tried:

GIT_DIR= npm install

with no success. Did change the error message to:

remote: npm ERR! git checkout master fatal: Not a git repository: ''

old message:

remote: npm ERR! git checkout master fatal: Not a git repository: '.'

isaacs closed this in af8c981 Jul 13, 2012

Contributor

hunterloftis commented Jul 13, 2012

For future reference, this will work:

GIT_DIR = (whatever)
GIT_WORK_TREE = (whatever)

... do what you have to ...

unset GIT_DIR
unset GIT_WORK_TREE
npm install
Contributor

Marsup commented Jul 31, 2012

Ignoring the whole git environment is causing me troubles, notably the GIT_PROXY_COMMAND in my case. Would it be possible to add some exceptions to this rule ?

Owner

isaacs commented Aug 1, 2012

@Marsup Patch welcome.

Contributor

Marsup commented Aug 1, 2012

I'll do. Do you think such exceptions should be hardcoded or given through config/CLI ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment