0

我使用过 Node.js 墨盒(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 ]

package.json 中使用的语义版本(例如:-glob@'^3.2.9* strong text *)似乎存在问题。

当我尝试从 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: 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)

4

1 回答 1

0

You need to place your dependencies into your package.json file and do a git push to install them, you can't run npm install on the server, you don't have access to the proper directories.

于 2014-04-11T15:52:19.993 回答