mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
use correct npm when running c9 install on docker workspaces
This commit is contained in:
parent
780dbe57ed
commit
527ffb72b8
@ -291,12 +291,21 @@ define(function(require, exports, module) {
|
||||
|
||||
prepareDirectory(function(err, packagePath){
|
||||
if (err) return callback(err);
|
||||
|
||||
var npmBin = [
|
||||
join(process.env.HOME, process.platform == "win32"? ".c9/npm.cmd" : ".c9/node/bin/npm"),
|
||||
"/mnt/shared/sbin/npm"
|
||||
];
|
||||
function installNPM(){
|
||||
spawn(join(process.env.HOME, process.platform == "win32"? ".c9/npm.cmd" : ".c9/node/bin/npm"), {
|
||||
spawn(npmBin[0], {
|
||||
args: ["install"],
|
||||
cwd: packagePath
|
||||
}, function(err) {
|
||||
if (err && err.code == 127) {
|
||||
npmBin.shift();
|
||||
if (npmBin.length)
|
||||
return installNPM();
|
||||
}
|
||||
|
||||
if (err) return callback(err);
|
||||
callback(null, { version: version });
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user