Nest-cli: "Entry module not found" when start or build with Nest CLI

Created on 2 Oct 2019  路  14Comments  路  Source: nestjs/nest-cli

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior


I'm trying to build monorepo from trilon.io/blog, but seem my nest-cli cannot build or start the monorepo with app and lib as shown in the images below. The path seems duplicate here: apps\webservice\apps\webservice\src\main.ts

ERROR in Entry module not found: Error: Can't resolve 'D:\Learning\nest-cli-test\apps\webservice\apps\webservice\src\main.ts' in 'D:\Learning\nest-cli-test'

image

image

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment

[System Information]
OS Version     : Windows 10
NodeJS Version : v10.16.3
YARN Version    : 1.17.3

[Nest Information]
platform-express version : 6.7.2
common version           : 6.7.2
core version             : 6.7.2
needs clarification

Most helpful comment

It's working! cc @kamilmysliwiec @Dominic-Preap

All 14 comments

What is your CLI version?

@kamilmysliwiec CLI version 6.9.1

Can you share the reproduction repository?

I can't reproduce your issue. What command did you run? What's your current directory?

Let's start again on my machine:

  • I'm on the Drive D:// (windows 10)
  • run nest new my-app, using yarn and wait until finish
  • run cd my-app
  • run nest g app webservice
  • run nest g lib config
  • run nest start webservice and got error

image

image

@johnbiundo could you try to reproduce this issue on Windows?

Happens the same to me, exact repro steps, only using npm.
I can make it to run replacing the "sourceRoot" property value in the nest-cli.json file back to "src" and start the project with npm run start:dev... it doesn't work with the nest start command directly

We've reproduced this on Windows. @kamilmysliwiec is working to push a fix ASAP. Thanks for reporting!

Fix has just been published in the latest version cc @filipevelhucopereira @Dominic-Preap

It's working! cc @kamilmysliwiec @Dominic-Preap

It's also working for me. Thanks everyone. cc @kamilmysliwiec @johnbiundo @filipevelhucopereira

my observation is a little different when you add class-validator as a dependency to the project following file starts throwing the error

node_modules/class-validator/decorator/decorators.d.ts:161:45

and the error is

error TS2503: Cannot find namespace 'ValidatorJS'.

a solution to this problem is to add following configuration in tsconfig.json file

"include": [ "custom-typings" ],

but then nest build commands start complaining and don't give any output (doesn't generate dist folder) nest run start:dev behaves the same way.

So my temporary solution is:

Step 1: Remove include section from tsconfig.json file and then build your project.
You will start seeing ValidatorJs errors on screen

Step 2: ctrl + c

Step 3: Now put back the configuration in tsconfig.json file.

Step 4: npm run start || npm run start:dev

Everyone is happy.

cc @kamilmysliwiec required a permanent solution on this. I will try to create reproduction repository.

@kedar9444 I also encountered this problem, I found the solution in the class-validator repository issue: setting "skipLibCheck": true in compilerOptions worked for me.
this is the link to the issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IonelLupu picture IonelLupu  路  5Comments

alexbuczynsky picture alexbuczynsky  路  5Comments

victordidenko picture victordidenko  路  4Comments

jylin picture jylin  路  5Comments

iangregsondev picture iangregsondev  路  6Comments