How to setup Jenkins on Openshift to run Node.js builds?

I have a Jenkins gear instance available on my Openshift plan. I would like to build my Javascript application with Grunt, which will then be hosted on a PHP 5.4 gear.

As Node.js instance available on Jenkins'slave is outdated, I install a newer version for my builds thanks Jenkins Node.js module, which allows you to download automatically Node.js binaries from Internet in your Jenkins slave.

This works great, as I can get node and npm versions. Here is my build script:

node --version
npm --version
which npm
npm config get prefix

And the build log:

[NodeTest] $ /bin/sh -xe /tmp/hudson493047459386546146.sh
+ node --version
v0.10.32
+ npm --version
1.4.28
+ which npm
/var/lib/openshift/542ab7f1500446fba1000081/app-root/data/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.10.32/bin/npm
+ npm config get prefix
/var/lib/openshift/542ab7f1500446fba1000081/app-root/data/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/NodeJS_0.10.32

But when I try to install a module, I get this error:

Script:

npm install grunt

Output:

npm ERR! Error: Attempt to unlock grunt, which hasn't been locked
npm ERR!     at unlock (/var/lib/openshift/542ab7f1500446fba1000081/app-root/data/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/    NodeJS_0.10.32/lib/node_modules/npm/lib/utils/locker.js:44:11)    
npm ERR!     at cb (/var/lib/openshift/542ab7f1500446fba1000081/app-root/data/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/    NodeJS_0.10.32/lib/node_modules/npm/lib/cache/add-local.js:30:5)
...

I tried to customize npm_config_userconfig or NPM_CONFIG_PREFIX environment variables but without success.

How to install NPM modules on Jenkins on Openshift ?