Skip to content

Error: Cannot find module 'preview-email' #1179

Open
@CristianAdi

Description

@CristianAdi

Describe the bug
After i run the first 2 commands from @nestjs-modules/mailer to install it and i run npm run start:dev, i get this big error :
"Error: Cannot find module 'preview-email'
Require stack:

  • /home/cristi/Documents/work/employee-record/node_modules/@nestjs-modules/mailer/dist/mailer.service.js
  • /home/cristi/Documents/work/employee-record/node_modules/@nestjs-modules/mailer/dist/mailer-core.module.js
  • /home/cristi/Documents/work/employee-record/node_modules/@nestjs-modules/mailer/dist/mailer.module.js
  • /home/cristi/Documents/work/employee-record/node_modules/@nestjs-modules/mailer/dist/index.js
  • /home/cristi/Documents/work/employee-record/node_modules/@nestjs-modules/mailer/index.js
  • /home/cristi/Documents/work/employee-record/dist/features/authentication/user/mail-verification.service.js
  • /home/cristi/Documents/work/employee-record/dist/features/authentication/user/user.service.js
  • /home/cristi/Documents/work/employee-record/dist/features/authentication/user/resolvers/user-mutation.resolver.js
  • /home/cristi/Documents/work/employee-record/dist/features/authentication/user/user.module.js
  • /home/cristi/Documents/work/employee-record/dist/app.module.js
  • /home/cristi/Documents/work/employee-record/dist/main.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1142:15)
    at Function.Module._load (node:internal/modules/cjs/loader:983:27)
    at Module.require (node:internal/modules/cjs/loader:1230:19)
    at require (node:internal/modules/helpers:179:18)
    at Object. (/home/cristi/Documents/work/employee-record/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:8:22)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
    at Module.load (node:internal/modules/cjs/loader:1205:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1021:12)
    at Module.require (node:internal/modules/cjs/loader:1230:19)"

I checked for other error but after installation i don t see any in the terminal.
Another think i figure out is about "preview-email" is missing from package-lock.json, i tryed to delete the node-module and install all, but still got the same error.
And the versions of what is installed on the project are up to date: ""dependencies": {
"@apollo/server": "^4.10.4",
"@casl/ability": "^6.7.1",
"@nestjs-modules/mailer": "^2.0.0",
"@nestjs/apollo": "^12.1.0",
"@nestjs/common": "^10.3.8",
"@nestjs/config": "^3.2.2",
"@nestjs/core": "^10.3.8",
"@nestjs/graphql": "^12.1.1",
"@nestjs/jwt": "^10.2.0",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.3.8",
"@nestjs/swagger": "^7.3.1",
"@nestjs/throttler": "^5.1.2",
"@nestjs/typeorm": "^10.0.2",
"bcrypt": "^5.1.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"dotenv": "^16.4.5",
"graphql": "^16.8.1",
"graphql-scalars": "^1.23.0",
"graphql-type-json": "^0.3.2",
"lodash": "^4.17.21",
"mysql2": "^3.9.7",
"nodemailer": "^6.9.13",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"pg": "^8.11.5",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1",
"typeorm": "^0.3.20"
},"

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Desktop (please complete the following information):

  • Ubuntu
  • Version 22.04

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions