Skip to content

Commit

Permalink
make debug as dependencies
Browse files Browse the repository at this point in the history
nodejs between v11.x - v15.5.1 has a bug: it will cache MODULE_NOT_FOUND when require a non-exits file([issue](nodejs/node#26926)). 

./debug.js try to require('debug'), if the 'debug' pkg not exits, nodejs will cache the result. Even install debug later in the same process(spawn npm install), require('debug') will still throw error

so, we should make 'debug' pacakge as dependencies.
  • Loading branch information
Simon Lu authored Jan 14, 2021
1 parent 9227630 commit 0da49f6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions debug.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
var debug;
try {
/* eslint global-require: off */
debug = require("debug")("follow-redirects");
}
catch (error) {
debug = function () { /* */ };
}
var debug = require("debug")("follow-redirects");

module.exports = debug;

0 comments on commit 0da49f6

Please sign in to comment.