Current Behavior:
npm.load does not accept any options. Only callback.
Expected Behavior:
npm.load actually recognizing my specified options and using them.
Steps To Reproduce:
steps to reproduce the behavior:
- In this environment...
- With the provided config...
- Run
const npm = require("npm");
npm.load({ loglevel: "silent" }, () => {
console.log("npm loaded");
});
// TypeError: must call as: npm.load(callback)
- See error...
Environment:
- OS: Linux Mint 20 Ulyana
- Node: v14.15.0
- npm: 6.4.12
What the .d.ts has to say about it:
export interface Static extends NodeJS.EventEmitter {
config: Config;
commands: Commands;
rollbacks: any[];
spinner: Spinner;
fullList: string[];
abbrevs: Dictionary<string>;
prefix: string;
bin: string;
globalBin: string;
dir: string;
globalDir: string;
root: string;
cache: string;
tmp: string;
load(cli: ConfigOptions): void; // Throws error
load(callback: SimpleCallback<Config>): void; // Works
load(cli: ConfigOptions, callback: SimpleCallback<Config>): void; // Throws error
deref(command: string): string;
}
Temporary Workaround
Note that with this workaround you can't install multiple modules in one line
const { exec } = require("child_process");
exec("npm <command> <options>");
Current Behavior:
npm.load does not accept any options. Only callback.
Expected Behavior:
npm.load actually recognizing my specified options and using them.
Steps To Reproduce:
steps to reproduce the behavior:
Environment:
What the .d.ts has to say about it:
Temporary Workaround
Note that with this workaround you can't install multiple modules in one line