Giter VIP home page Giter VIP logo

Comments (7)

Rmannn avatar Rmannn commented on May 30, 2024

Could you be more precise about the error you have please ?
This package is installed using production on many projects.

Required dependencies are listed in peer dependencies cause they are required at an higher level in your application.
Dev dependencies are just here to recreate a complete app environment during dev.
ex.
Commander is required by @nestjs/cli, commander is a peer dependency
rxjs is required by nestjs/core, same result
nestjs/common should be installed at root of you app, it's also a peer dependency.

Before to install in production mode you have to install peer deps (and framework deps too) Once peer dependencies are installed, you can install it using production.

This is not a standalone package, and it is supposed to work in a pre existing environement. That means any application that already have installed nestjs core, common and the commander packages.

from nestjs-console.

Rmannn avatar Rmannn commented on May 30, 2024

Maybe I should add the install workflow in the documentation but it's something that is very common in a lot of NPM packages.

During development of your app

  1. yarn add nestjs-console
  2. look for missing required peer dependencies.
  3. install missing peer dependencies.

Then during production deployment, you could install using a yarn install --production

from nestjs-console.

panki avatar panki commented on May 30, 2024

If I do yarn install --production, I get following error trying run my console app:

/app # node dist/console.js
internal/modules/cjs/loader.js:797
    throw err;
    ^

Error: Cannot find module 'lodash'
Require stack:
- /app/node_modules/nestjs-console/lib/scanner.js
- /app/node_modules/nestjs-console/lib/module.js
- /app/node_modules/nestjs-console/lib/bootstrap.js
- /app/node_modules/nestjs-console/lib/index.js
- /app/dist/console.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/app/node_modules/nestjs-console/lib/scanner.js:3:18)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/app/node_modules/nestjs-console/lib/scanner.js',
    '/app/node_modules/nestjs-console/lib/module.js',
    '/app/node_modules/nestjs-console/lib/bootstrap.js',
    '/app/node_modules/nestjs-console/lib/index.js',
    '/app/dist/console.js'
  ]
}

Is it helpful? do yo need my package.json or yarn.lock?

from nestjs-console.

Rmannn avatar Rmannn commented on May 30, 2024

Ok, lodash is missing in dependencies.
This was already fixed in the v2 branch that is going to be published on npm this week asap. (tests in progress)
We didn't see this issue in the past.
Thank you for the report.

from nestjs-console.

panki avatar panki commented on May 30, 2024

Ok, great!

from nestjs-console.

panki avatar panki commented on May 30, 2024

Any news about v2?

from nestjs-console.

Rmannn avatar Rmannn commented on May 30, 2024

Could you try the nestjs-console@next version from npm ?

from nestjs-console.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.