TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type undefined at validateString (internal/validators.js:125:11)


TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)

出现此错误,是因为我在node中使用require引入库的时候忘了加引号,在加载依赖包的时候,识别不到,才会出现如下错误:

 在node中使用require引入库的时候:一定要加引号,如下所示:

    var pg = require('pg');

如果写成如下样子,将会报错,一定要细心

var pg = require(pg);
原文地址:https://www.cnblogs.com/lxz123/p/13353260.html