mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-11 02:41:52 +02:00
Support npm@5 and yarn (#6010)
* Support npm@5 and yarn Use package.default.json Partial #6008 - Overwrite package.json with package.default.json values - `dependencies` field is merged with package.default.json version taking precidence - `./nodebb upgrade` automatically does those things and runs `git pull` - use `./nodebb upgrade --dev` to avoid the `git pull` * added logic to preserve extraneous plugins installed in node_modules/ * Don't automatically git pull * Simplify package-install, run it on upgrade just in case
This commit is contained in:
committed by
Julian Lam
parent
e609e497b3
commit
dfad76120d
@@ -6,6 +6,7 @@ var path = require('path');
|
||||
var fs = require('fs');
|
||||
var nconf = require('nconf');
|
||||
var os = require('os');
|
||||
var cproc = require('child_process');
|
||||
|
||||
var db = require('../database');
|
||||
var meta = require('../meta');
|
||||
@@ -107,7 +108,7 @@ module.exports = function (Plugins) {
|
||||
}
|
||||
|
||||
function runNpmCommand(command, pkgName, version, callback) {
|
||||
require('child_process').execFile((process.platform === 'win32') ? 'npm.cmd' : 'npm', [command, pkgName + (command === 'install' ? '@' + version : ''), '--no-save'], function (err, stdout) {
|
||||
cproc.execFile((process.platform === 'win32') ? 'npm.cmd' : 'npm', [command, pkgName + (command === 'install' ? '@' + version : ''), '--save'], function (err, stdout) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user