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引入库的时候忘了加引号,在加载依赖包的时候,识别不到,才会出现如下错误:

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引入库的时候:一定要加引号,如下所示:

    var pg = require('pg');

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

var pg = require(pg);

相关文章:

  • 2022-03-07
  • 2021-07-05
  • 2021-05-02
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
猜你喜欢
  • 2021-07-05
  • 2022-12-23
  • 2021-11-17
  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案