Onix-Systems / nest-js-boilerplate

Nest.js boilerplate
https://onix-systems.com/
MIT License
224 stars 41 forks source link

Dependency missing errors #28

Closed aboiko1 closed 2 years ago

aboiko1 commented 2 years ago

Dependency missing errors

Ubuntu: 20.04.3 LTS 64-bit

Node.js version: 16.13.2

NPM version: 8.1.2

Boilerplate configuration:

PM: npm,
Install stable packages?: yes
Application settings: default,
Auth: jwt,
Json Api: no
DataBase: MySQL,
Emails: no,
WebSockets: no,
Docker container: yes,
Heroku: no

Errors while installing:

npm ERR! > nestjs-redis@1.3.3 prepublish
npm ERR! > yarn run build
......
npm ERR! sh: 1: yarn: not found
npm ERR! npm ERR! code 127

Errors after starting project:

Cannot find module '@nestjs/passport'
Cannot find module '@nestjs/jwt'
Cannot find module 'nestjs-redis'
Cannot find module 'ioredis'
// And after manually installing this packages appears new errors
Error: Cannot find module 'passport-local'
Error: Cannot find module 'passport-jwt'

After installing missing dependencies appears new error:

ERROR [ExceptionHandler] Nest can't resolve dependencies of the RedisCoreModule (Symbol(REDIS_MODULE_OPTIONS), ?). Please make sure that the argument ModuleRef at index [1] is available in the RedisCoreModule context.

It can be resolved by replacing nestjs-redis module by @liaoliaots/nestjs-redis package and modifying RedisModule code in app.module.ts file:

// New code for RedisModule
RedisModule.forRoot({
      config: {
        url: process.env.REDIS_URL,
      },
}),

After all of this work you will be able to successfully start application

aboiko1 commented 2 years ago

Cant reproduce on another PC