問題:自己編寫的模塊,發現斷點根本不進入
控制檯也沒報錯嗎,然後是複製別的模塊,先刪除乾淨,多餘代碼,再看斷點能進去嗎,
能的話依次一點點添加不能進入斷點的模塊的代碼,最終確定問題代碼塊
雖然煩瑣,但卻很奏效。
下面是require我自己的模塊
DeviceList[_id] = require(path + '/agreement/' + DataListAll[0][j].agreement);
原因: const COMMON = require(path + '/libs/common'); 我沒有 npm install uuid
而common.js的代碼如下
const UUID = require('uuid');
/**
* 獲取UUID
*/
function getUid(){
return UUID.v1().toLowerCase().replaceAll("-","");
}
exports.getUid = getUid;
僅僅作爲筆記,不喜勿噴~~