pluginfw: Call `npm.load()` before using `npm`
This code is only used when testing `read-installed.js` by running it directly (e.g., `node src/static/js/pluginfw/read-installed.js`).pull/4675/head^2
parent
a5bde7982a
commit
c64ee6ff4c
|
@ -303,11 +303,14 @@ if (module === require.main) {
|
||||||
console.error('testing');
|
console.error('testing');
|
||||||
|
|
||||||
let called = 0;
|
let called = 0;
|
||||||
readInstalled(process.cwd(), (er, map) => {
|
npm.load({}, (err) => {
|
||||||
console.error(called++);
|
if (err != null) throw err;
|
||||||
if (er) return console.error(er.stack || er.message);
|
readInstalled(process.cwd(), (er, map) => {
|
||||||
cleanup(map);
|
console.error(called++);
|
||||||
console.error(util.inspect(map, true, 10, true));
|
if (er) return console.error(er.stack || er.message);
|
||||||
|
cleanup(map);
|
||||||
|
console.error(util.inspect(map, true, 10, true));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const seen = [];
|
const seen = [];
|
||||||
|
|
Loading…
Reference in New Issue