我已在我的OpenShift帐户中部署了即时应用Jenkins
。我创建了一份新工作,它从Bitbucket中提取代码。这是一个NodeJS项目,所以我添加了一个要执行的操作:
npm install
但我得到了许可错误:
npm ERR! Error: EACCES, mkdir '/var/lib/openshift/56cef0c72d5271b01a000010/.npm'
npm ERR! { [Error: EACCES, mkdir '/var/lib/openshift/56cef0c72d5271b01a000010/.npm']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/var/lib/openshift/56cef0c72d5271b01a000010/.npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 2.6.32-573.18.1.el6.x86_64
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /var/lib/openshift/56cef0c72d5271b01a000010/app-root/data/workspace/oauth2-server
npm ERR! node -v v0.6.20
npm ERR! npm -v 1.1.37
npm ERR! path /var/lib/openshift/56cef0c72d5271b01a000010/.npm
npm ERR! code EACCES
npm ERR! message EACCES, mkdir '/var/lib/openshift/56cef0c72d5271b01a000010/.npm'
npm ERR! errno 3
npm ERR! 3 errno
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/lib/openshift/56cef0c72d5271b01a000010/app-root/data/workspace/oauth2-server/npm-debug.log
npm ERR! not ok code undefined
npm ERR! not ok code 3
Build step 'Execute shell' marked build as failure
显然,我无权在OpenShift中使用sudo npm install
。我已经读过这个问题,但我无法解决。
有什么办法可以解决吗?
答案 0 :(得分:0)
以下是您需要做的事情: