无法将从属节点模块安装到OpenShift

时间:2014-04-11 02:24:52

标签: node.js openshift mean-stack

我使用过Node.js Cartridge(0.10)。我已将我的代码克隆到OpenShift云(PaaS)。当我使用npm install时,它会抛出一些错误。我从其他问题中尝试了一些建议,但没有运气。

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 meanio@0.4.1
249 silly lockFile 7619eab2-mongodb-1-4-0 mongodb@^1.4.0
250 silly lockFile 7619eab2-mongodb-1-4-0 mongodb@^1.4.0
251 silly lockFile 421b7bdc-mkdirp-0-3-5 mkdirp@^0.3.5
252 silly lockFile 421b7bdc-mkdirp-0-3-5 mkdirp@^0.3.5
253 info uninstall meanio@0.4.1
254 silly lockFile de2fbae8-swig-1-3-2 swig@^1.3.2
255 silly lockFile de2fbae8-swig-1-3-2 swig@^1.3.2
256 silly lockFile dd7abdee-colors-0-6-2 colors@^0.6.2
257 silly lockFile dd7abdee-colors-0-6-2 colors@^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 meanio@0.4.1
259 verbose /var/lib/openshift/5346ca634382ec4c630001d1/app-root/runtime/repo/node_modules/.bin,[object Object] binRoot
260 info postuninstall meanio@0.4.1
261 silly lockFile f26b74be-which-1-0-5 which@^1.0.5
262 silly lockFile f26b74be-which-1-0-5 which@^1.0.5
263 error Error: No compatible version found: opener@'^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     <npm-@googlegroups.com>
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 * 强文 *) 用于package.json。

当我尝试从package.json中删除所有“^”字符时。它似乎工作。但是当我的模块所需的模块(在package.json中给出)具有这个“^”时它就失败了。所有这些都归结为我们在盒式磁带中的npm版本(npm --version 1.2 0.17) 我的应用程序需要npm(1.3。*)。我认为open shift也不允许升级npm。那么,我们如何在openshift中升级npm?

2290 error Error: No compatible version found: glob@'^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)

1 个答案:

答案 0 :(得分:0)

您需要将您的依赖项放入package.json文件并执行git push来安装它们,您无法在服务器上运行npm install,您无法访问正确的目录。