mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
feat: detect alternative package managers based on lockfile
If a package manager is not explicitly set in config.json or passed-in via argv/env, NodeBB will now check for the presence of alternative package managers' lockfiles and adjust the package manager to-be-used accordingly. If the standard npm lockfile exists, npm will always be used.
This commit is contained in:
@@ -13,10 +13,9 @@ const db = require('../database');
|
||||
const meta = require('../meta');
|
||||
const pubsub = require('../pubsub');
|
||||
const { paths } = require('../constants');
|
||||
const pkgInstall = require('../cli/package-install');
|
||||
|
||||
const supportedPackageManagerList = require('../cli/package-install').supportedPackageManager;
|
||||
// load config from src/cli/package-install.js
|
||||
const packageManager = supportedPackageManagerList.indexOf(nconf.get('package_manager')) >= 0 ? nconf.get('package_manager') : 'npm';
|
||||
const packageManager = pkgInstall.getPackageManager();
|
||||
let packageManagerExecutable = packageManager;
|
||||
const packageManagerCommands = {
|
||||
yarn: {
|
||||
|
||||
Reference in New Issue
Block a user