2014-10-31 73 views
1

我在Openshift中使用Python 2.7和Mysql 5.5磁帶盒的應用程序,我想在其上運行Django應用程序。我用this開始構建應用程序。在Openshift Django中使用Bower

在本地,我使用bower作爲包管理器,所以我安裝了django-bower,所以我可以製作./manage.py bower install。我也已經安裝了全球的涼亭:

>which bower 
/usr/local/bin/bower 

在本地一切正常,當我嘗試在openshift中部署時出現問題。我讀過here那亭子應安裝在openshift但顯然,我沒有全球的裝機量涼亭:

which: no bower in (/var/lib/openshift/5425aaa0438****47000094/python//virtenv/bin:/var/lib/openshift/5425aaa0438****47000094/python//bin:/opt/rh/python27/root/usr/bin:/bin:/usr/bin:/usr/sbin) 

所以我想安裝運行以下命令:

export HOME=$OPENSHIFT_REPO_DIR 
cd $HOME 
npm cache clear 
npm cache clean 
npm install bower --prefix $OPENSHIFT_REPO_DIR 

但失敗在這個輸出的最後一個命令:

npm http GET https://registry.npmjs.org/bower 
npm http 200 https://registry.npmjs.org/bower 
npm http GET https://registry.npmjs.org/bower/-/bower-1.3.12.tgz 
npm http 200 https://registry.npmjs.org/bower/-/bower-1.3.12.tgz 
npm WARN engine [email protected]: wanted: {"node":">=0.10.0"} (current: {"node":"0.6.20","npm":"1.1.37"}) 
çnpm http GET https://registry.npmjs.org/abbrev 
npm http GET https://registry.npmjs.org/archy/0.0.2 
npm http GET https://registry.npmjs.org/bower-config 
npm http GET https://registry.npmjs.org/bower-endpoint-parser 
npm http GET https://registry.npmjs.org/bower-json 
npm http GET https://registry.npmjs.org/bower-logger 
npm http GET https://registry.npmjs.org/bower-registry-client 
npm http GET https://registry.npmjs.org/chalk/0.5.0 
npm http GET https://registry.npmjs.org/cardinal/0.4.0 
npm http GET https://registry.npmjs.org/chmodr/0.1.0 
npm http GET https://registry.npmjs.org/decompress-zip/0.0.8 
npm http GET https://registry.npmjs.org/fstream 
npm http GET https://registry.npmjs.org/fstream-ignore 
npm http GET https://registry.npmjs.org/glob 
npm http GET https://registry.npmjs.org/graceful-fs 
npm http GET https://registry.npmjs.org/handlebars 
npm http GET https://registry.npmjs.org/inquirer/0.7.1 
npm http GET https://registry.npmjs.org/insight/0.4.3 
npm http GET https://registry.npmjs.org/is-root 
npm http GET https://registry.npmjs.org/junk 
npm http GET https://registry.npmjs.org/lockfile 
npm http GET https://registry.npmjs.org/mkdirp/0.5.0 
npm http GET https://registry.npmjs.org/lru-cache 
npm http GET https://registry.npmjs.org/nopt 
npm http GET https://registry.npmjs.org/mout 
npm http GET https://registry.npmjs.org/opn 
npm http GET https://registry.npmjs.org/osenv/0.1.0 
npm http GET https://registry.npmjs.org/p-throttler/0.1.0 
npm http GET https://registry.npmjs.org/promptly/0.2.0 
npm http GET https://registry.npmjs.org/q 
npm http GET https://registry.npmjs.org/request 
npm http GET https://registry.npmjs.org/request-progress/0.3.0 
npm http GET https://registry.npmjs.org/retry/0.6.0 
npm http GET https://registry.npmjs.org/rimraf 
npm http GET https://registry.npmjs.org/semver 
[MORE OF THE SAME] 
npm ERR! Error: ENOENT, chmod '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/graceful-fs/polyfills.js' 
npm ERR! { [Error: ENOENT, chmod '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/graceful-fs/polyfills.js'] 
npm ERR! errno: 34, 
npm ERR! code: 'ENOENT', 
npm ERR! path: '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/graceful-fs/polyfills.js', 
npm ERR! fstream_finish_call: 'chmod', 
npm ERR! fstream_type: 'File', 
npm ERR! fstream_path: '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/graceful-fs/polyfills.js', 
npm ERR! fstream_class: 'FileWriter', 
npm ERR! fstream_stack: [ 'Object.oncomplete (/usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19)' ] } 
npm ERR! You may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Linux 2.6.32-431.29.2.el6.x86_64 
npm ERR! command "node" "/usr/bin/npm" "install" "bower" "--prefix" "/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/" 
npm ERR! cwd /var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo 
npm ERR! node -v v0.6.20 
npm ERR! npm -v 1.1.37 
npm ERR! path /var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/graceful-fs/polyfills.js 
npm ERR! fstream_path /var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/graceful-fs/polyfills.js 
npm ERR! fstream_type File 
npm ERR! fstream_class FileWriter 
npm ERR! fstream_finish_call chmod 
npm ERR! code ENOENT 
npm ERR! message ENOENT, chmod '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/graceful-fs/polyfills.js' 
npm ERR! errno 34 
npm ERR! fstream_stack Object.oncomplete (/usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19) 
npm ERR! 34 errno 
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/bower-registry-client' 
npm ERR! error rolling back [email protected] { [Error: ENOTEMPTY, rmdir '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/bower-registry-client'] 
npm ERR! error rolling back errno: 53, 
npm ERR! error rolling back code: 'ENOTEMPTY', 
npm ERR! error rolling back path: '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/bower-registry-client' } 
npm ERR! Error: No compatible version found: [email protected]'^1.1.0' 
npm ERR! Valid install targets: 
npm ERR! ["0.1.0","0.1.1","0.1.2","0.2.0","1.0.0","1.1.0"] 
npm ERR!  at installTargetsError (/usr/lib/node_modules/npm/lib/cache.js:588:10) 
npm ERR!  at /usr/lib/node_modules/npm/lib/cache.js:466:15 
npm ERR!  at saved (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:136:7) 
npm ERR!  at Object.oncomplete (/usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:230:7) 
npm ERR! [Error: No compatible version found: [email protected]'^1.1.0' 
npm ERR! Valid install targets: 
npm ERR! ["0.1.0","0.1.1","0.1.2","0.2.0","1.0.0","1.1.0"]] 
npm ERR! You may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Linux 2.6.32-431.29.2.el6.x86_64 
npm ERR! command "node" "/usr/bin/npm" "install" "bower" "--prefix" "/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/" 
npm ERR! cwd /var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo 
npm ERR! node -v v0.6.20 
npm ERR! npm -v 1.1.37 
npm ERR! message No compatible version found: [email protected]'^1.1.0' 
npm ERR! message Valid install targets: 
npm ERR! message ["0.1.0","0.1.1","0.1.2","0.2.0","1.0.0","1.1.0"] 
npm ERR! Error: ENOENT, chmod '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/rimraf/test/test-sync.js' 
npm ERR! { [Error: ENOENT, chmod '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/rimraf/test/test-sync.js'] 
npm ERR! errno: 34, 
npm ERR! code: 'ENOENT', 
npm ERR! path: '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/rimraf/test/test-sync.js', 
npm ERR! fstream_finish_call: 'chmod', 
npm ERR! fstream_type: 'File', 
npm ERR! fstream_path: '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/rimraf/test/test-sync.js', 
npm ERR! fstream_class: 'FileWriter', 
npm ERR! fstream_stack: [ 'Object.oncomplete (/usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19)' ] } 
npm ERR! You may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Linux 2.6.32-431.29.2.el6.x86_64 
npm ERR! command "node" "/usr/bin/npm" "install" "bower" "--prefix" "/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/" 
npm ERR! cwd /var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo 
npm ERR! node -v v0.6.20 
npm ERR! npm -v 1.1.37 
npm ERR! path /var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/rimraf/test/test-sync.js 
npm ERR! fstream_path /var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/rimraf/test/test-sync.js 
npm ERR! fstream_type File 
npm ERR! fstream_class FileWriter 
npm ERR! fstream_finish_call chmod 
npm ERR! code ENOENT 
npm ERR! message ENOENT, chmod '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/rimraf/test/test-sync.js' 
npm ERR! errno 34 
npm ERR! fstream_stack Object.oncomplete (/usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:305:19) 
npm ERR! 34 errno 
npm ERR! Error: ENOENT, lstat '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/mout/string.js' 
npm ERR! { [Error: ENOENT, lstat '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/mout/string.js'] 
npm ERR! errno: 34, 
npm ERR! code: 'ENOENT', 
npm ERR! path: '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/mout/string.js', 
npm ERR! fstream_type: 'File', 
npm ERR! fstream_path: '/var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/node_modules/bower/node_modules/mout/string.js', 
npm ERR! fstream_class: 'FileWriter', 
npm ERR! fstream_stack: [ 'Object.oncomplete (/usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26)' ] } 
npm ERR! You may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Linux 2.6.32-431.29.2.el6.x86_64 
[MORE OF THE SAME] 
npm ERR! 34 errno 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /var/lib/openshift/5425aaa04382ec0447000094/app-root/runtime/repo/npm-debug.log 
npm ERR! not ok code undefined 
npm ERR! not ok code 34 

任何想法??

謝謝。

回答

0

ssh進入你的裝備,cd到~/app-root/data/,然後運行npm install bower。我能夠安裝它沒有任何問題:

npm http 304 https://registry.npmjs.org/es6-symbol 
[email protected] node_modules/bower 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], mute-str[email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
0
rhc ssh [PROJECT NAME] 
cd nodejs 
npm install bower