2014-04-11 103 views
0

我已經使用Node.js Cartridge(0.10)。我已將我的代碼克隆到OpenShift雲(PaaS)。當我使用npm install時,會引發一些錯誤。我嘗試了幾個其他問題的建議,但沒有運氣。無法安裝從屬節點模塊到OpenShift

NPM-的debug.log:

245 verbose about to build /var/lib/openshift/5346ca634382ec4c630001d1/app-root/runtime/repo/node_modules/meanio 
246 info /var/lib/openshift/5346ca634382ec4c630001d1/app-root/runtime/repo/node_modules/meanio unbuild 
247 verbose from cache /var/lib/openshift/5346ca634382ec4c630001d1/app-root/runtime/repo/node_modules/meanio/package.json 
248 info preuninstall [email protected] 
249 silly lockFile 7619eab2-mongodb-1-4-0 [email protected]^1.4.0 
250 silly lockFile 7619eab2-mongodb-1-4-0 [email protected]^1.4.0 
251 silly lockFile 421b7bdc-mkdirp-0-3-5 [email protected]^0.3.5 
252 silly lockFile 421b7bdc-mkdirp-0-3-5 [email protected]^0.3.5 
253 info uninstall [email protected] 
254 silly lockFile de2fbae8-swig-1-3-2 [email protected]^1.3.2 
255 silly lockFile de2fbae8-swig-1-3-2 [email protected]^1.3.2 
256 silly lockFile dd7abdee-colors-0-6-2 [email protected]^0.6.2 
257 silly lockFile dd7abdee-colors-0-6-2 [email protected]^0.6.2 
258 verbose true,/var/lib/openshift/5346ca634382ec4c630001d1/app-root/runtime/repo/node_modules,/var/lib/openshift/5346ca634382ec4c630001d1/app-root/runtime/repo/node_modules unbuild [email protected] 
259 verbose /var/lib/openshift/5346ca634382ec4c630001d1/app-root/runtime/repo/node_modules/.bin,[object Object] binRoot 
260 info postuninstall [email protected] 
261 silly lockFile f26b74be-which-1-0-5 [email protected]^1.0.5 
262 silly lockFile f26b74be-which-1-0-5 [email protected]^1.0.5 
263 error Error: No compatible version found: [email protected]'^1.3.0' 
263 error Valid install targets: 
263 error ["1.0.0","1.0.1","1.1.0","1.2.0","1.3.0"] 
263 error  at installTargetsError (/opt/rh/nodejs010/root/usr/lib/node_modules/npm/lib/cache.js:685:10) 
263 error  at /opt/rh/nodejs010/root/usr/lib/node_modules/npm/lib/cache.js:607:10 
263 error  at saved (/opt/rh/nodejs010/root/usr/lib/node_modules/npm-registry-client/lib/get.js:138:7) 
263 error  at Object.oncomplete (fs.js:107:15) 
264 error If you need help, you may report this log at: 
264 error  <http://github.com/isaacs/npm/issues> 
264 error or email it to: 
264 error  <[email protected]> 
265 error System Linux 2.6.32-431.11.2.el6.bz844450.x86_64 
266 error command "node" "/opt/rh/nodejs010/root/usr/bin/npm" "install" "meanio" 
267 error cwd /var/lib/openshift/5346ca634382ec4c630001d1/app-root/runtime/repo 
268 error node -v v0.10.5 
269 error npm -v 1.2.17 
270 verbose exit [ 1, true ] 

似乎還有語義版中的問題(如:-glob @^* 3.2.9強文本 *)包中使用 以.json。

當我嘗試從package.json中刪除所有「^」字符時。它似乎工作。但是,當我的模塊需要的模塊(在package.json中給出)具有這個「^」時,它會失敗。它全部變成我們在盒式磁帶中使用的npm版本(npm --version 1.2 .17) 和我的應用程序需要npm(1.3。*)。我認爲open shift不允許升級npm。所以,我們如何在openshift中升級npm?

2290 error Error: No compatible version found: [email protected]'^3.2.9' 2290 error Valid install targets: 2290 error ["1.1.0","2.0.9","2.0.8","2.0.7","2.1.0","3.0.0","3.0.1","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.9","3.1.10","3.1.11","3.1.12","3.1.13","3.1.14","3.1.15","3.1.16","3.1.17","3.1.18","3.1.19","3.1.20","3.1.21","3.2.0","3.2.1","3.2.3","3.2.4","3.2.5","3.2.6","3.2.7","3.2.8","3.2.9"] 2290 error at installTargetsError (/opt/rh/nodejs010/root/usr/lib/node_modules/npm/lib/cache.js:685:10)

回答

0

你需要你的依賴放入您的package.json文件,做一個混帳推到安裝它們,你不能運行NPM在服務器上安裝,您沒有訪問到正確的目錄。