当前位置: 首页 > 工具软件 > dotenv > 使用案例 >

Error: Cannot find module ‘dotenv‘的解决方法

狄赞
2023-12-01

【现象】

Error: Cannot find module 'dotenv'
Require stack:
- /var/pdf/pdf/app.js
- /var/pdf/pdf/www
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/var/pdf/pdf/app.js:6:16)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/var/pdf/pdf/app.js',
    '/var/pdf/pdf/bin'
  ]
}

【解决方法】

npm install dotenv

 类似资料: