我有一个使用python cartridge的webapp。我需要少用一些,但是当我尝试安装时:
npm install less@1.6.3
我有一个错误:
npm install -g less@1.6.3
npm http GET //registry.npmjs.org/less/1.6.3
npm http 200 //registry.npmjs.org/less/1.6.3
npm http GET https://registry.npmjs.org/less/-/less-1.6.3.tgz
npm http 200 https://registry.npmjs.org/less/-/less-1.6.3.tgz
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/less'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/less']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/less',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/less',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! 'Object.oncomplete (/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:51:17)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 2.6.32-573.12.1.el6.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "less@1.6.3"
npm ERR! cwd /var/lib/openshift/56fc035a2d5271ee8f00019a/app-root/runtime/repo
npm ERR! node -v v0.6.20
npm ERR! npm -v 1.1.37
npm ERR! path /usr/lib/node_modules/less
npm ERR! fstream_path /usr/lib/node_modules/less
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! message EACCES, mkdir '/usr/lib/node_modules/less'
npm ERR! errno 3
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack Object.oncomplete (/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:51:17)
npm ERR! 3 errno
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/lib/openshift/56fc035a2d5271ee8f00019a/app-root/runtime/repo/npm-debug.log
npm ERR! not ok code undefined
npm ERR! not ok code 3
我尝试
sudo npm install less@1.6.3
但我们无法访问sudo
上的openshift
。
如果有openshift
的专家可以帮助我,我将非常感激:)
谢谢你的帮助:)
我尝试没有-g,但它不适用于openshift
npm http GET https://registry.npmjs.org/less
npm http 304 https://registry.npmjs.org/less
npm http GET https://registry.npmjs.org/less/-/less-1.6.3.tgz
npm http 200 https://registry.npmjs.org/less/-/less-1.6.3.tgz
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/clean-css
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/source-map
npm http 200 https://registry.npmjs.org/mkdirp
npm http 200 https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm http GET https://registry.npmjs.org/mime/-/mime-1.2.11.tgz
npm http 200 https://registry.npmjs.org/source-map
npm http 200 https://registry.npmjs.org/request
npm http 200 https://registry.npmjs.org/clean-css
npm http GET https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz
npm http 200 https://registry.npmjs.org/mime/-/mime-1.2.11.tgz
npm http GET https://registry.npmjs.org/clean-css/-/clean-css-2.0.8.tgz
npm http GET https://registry.npmjs.org/request/-/request-2.69.0.tgz
npm http 200 https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm http 200 https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz
npm http 200 https://registry.npmjs.org/request/-/request-2.69.0.tgz
npm http 200 https://registry.npmjs.org/clean-css/-/clean-css-2.0.8.tgz
npm WARN engine clean-css@2.0.8: wanted: {"node":">=0.8.0"} (current: {"node":"0.6.20","npm":"1.1.37"})
npm WARN engine request@2.69.0: wanted: {"node":">=0.8.0"} (current: {"node":"0.6.20","npm":"1.1.37"})
npm WARN engine source-map@0.1.43: wanted: {"node":">=0.8.0"} (current: {"node":"0.6.20","npm":"1.1.37"})
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/aws-sign2
npm http GET https://registry.npmjs.org/aws4
npm http GET https://registry.npmjs.org/bl
npm http GET https://registry.npmjs.org/caseless
npm http GET https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/extend
npm http GET https://registry.npmjs.org/har-validator
npm http GET https://registry.npmjs.org/hawk
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/isstream
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/is-typedarray
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/stringstream
npm http GET https://registry.npmjs.org/tough-cookie
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/mime-types
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/amdefine
npm http 200 https://registry.npmjs.org/aws-sign2
npm http 200 https://registry.npmjs.org/bl
npm http 200 https://registry.npmjs.org/commander
npm http 200 https://registry.npmjs.org/form-data
npm http 200 https://registry.npmjs.org/aws4
npm http 200 https://registry.npmjs.org/forever-agent
npm http 200 https://registry.npmjs.org/caseless
npm http GET https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz
npm http 200 https://registry.npmjs.org/combined-stream
npm http GET https://registry.npmjs.org/bl/-/bl-1.0.3.tgz
npm http GET https://registry.npmjs.org/commander/-/commander-2.0.0.tgz
npm http 200 https://registry.npmjs.org/extend
npm http 200 https://registry.npmjs.org/isstream
npm http GET https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz
npm http GET https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz
npm http 200 https://registry.npmjs.org/har-validator
npm http 200 https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz
npm http GET https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz
npm http 200 https://registry.npmjs.org/is-typedarray
npm http 200 https://registry.npmjs.org/json-stringify-safe
npm http 200 https://registry.npmjs.org/hawk
npm http 200 https://registry.npmjs.org/stringstream
npm WARN optional dep failed, continuing request@2.69.0
npm http 200 https://registry.npmjs.org/tunnel-agent
npm http 200 https://registry.npmjs.org/mime-types
npm http 200 https://registry.npmjs.org/node-uuid
npm http 200 https://registry.npmjs.org/qs
npm http 200 https://registry.npmjs.org/bl/-/bl-1.0.3.tgz
npm http 200 https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz
npm http 200 https://registry.npmjs.org/oauth-sign
npm http 200 https://registry.npmjs.org/amdefine
npm http 200 https://registry.npmjs.org/tough-cookie
npm http GET https://registry.npmjs.org/extend/-/extend-3.0.0.tgz
npm http GET https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz
npm http GET https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz
npm http GET https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz
npm http GET https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz
npm http GET https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz
npm http GET https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz
npm http GET https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz
npm http 200 https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz
npm http 200 https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz
npm http 200 https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz
npm http 200 https://registry.npmjs.org/commander/-/commander-2.0.0.tgz
npm http 200 https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz
npm http 200 https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz
npm http 200 https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz
npm http 200 https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz
npm http 200 https://registry.npmjs.org/extend/-/extend-3.0.0.tgz
npm http 200 https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz
npm http GET https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz
npm http GET https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz
npm http GET https://registry.npmjs.org/qs/-/qs-6.0.2.tgz
npm http GET https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz
npm http GET https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz
npm http GET https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz
npm http GET https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz
npm http 200 https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz
npm http 200 https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz
npm http 200 https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz
npm http 200 https://registry.npmjs.org/qs/-/qs-6.0.2.tgz
npm http 200 https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz
npm http 200 https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz
npm http 200 https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz
npm http 200 https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz
npm http 200 https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz
npm http 200 https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz
less@1.6.3 node_modules/less
├── mime@1.2.11
├── mkdirp@0.3.5
├── source-map@0.1.43 (amdefine@1.0.0)
└── clean-css@2.0.8 (commander@2.0.0)
npm ERR! tar pack Error reading /tmp/npm-445706/1459419659599-0.8059858318883926/package
npm ERR! addLocalDirectory Could not pack "/tmp/npm-445706/1459419659599-0.8059858318883926/package" to "/var/lib/openshift/56fcf5870c1e668c6900009e/app-root/runtime/.npm/qs/6.0.2/package.tgz"
npm ERR! Error: ENOENT, lstat '/tmp/npm-445706/1459419659637-0.6426318113226444/package/lib/pubsuffix.js'
npm ERR! { [Error: ENOENT, lstat '/tmp/npm-445706/1459419659637-0.6426318113226444/package/lib/pubsuffix.js']
npm ERR! errno: 34,
npm ERR! code: 'ENOENT',
npm ERR! path: '/tmp/npm-445706/1459419659637-0.6426318113226444/package/lib/pubsuffix.js',
npm ERR! fstream_type: 'File',
npm ERR! fstream_path: '/tmp/npm-445706/1459419659637-0.6426318113226444/package/lib/pubsuffix.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! <npm-@googlegroups.com>
npm ERR! System Linux 2.6.32-573.12.1.el6.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "less@1.6"
npm ERR! cwd /var/lib/openshift/56fcf5870c1e668c6900009e/app-root/runtime/repo
npm ERR! node -v v0.6.20
npm ERR! npm -v 1.1.37
npm ERR! path /tmp/npm-445706/1459419659637-0.6426318113226444/package/lib/pubsuffix.js
npm ERR! fstream_path /tmp/npm-445706/1459419659637-0.6426318113226444/package/lib/pubsuffix.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! message ENOENT, lstat '/tmp/npm-445706/1459419659637-0.6426318113226444/package/lib/pubsuffix.js'
npm ERR! errno 34
npm ERR! fstream_stack Object.oncomplete (/usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26)
npm ERR! 34 errno
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/lib/openshift/56fcf5870c1e668c6900009e/app-root/runtime/repo/npm-debug.log
npm ERR! not ok code undefined
npm ERR! not ok code 34
答案 0 :(得分:0)
export HOME=$HOME/app-root/runtime/repo cd app-root/runtime/repo npm install -g