#npm run startdev not working after change

58 messages · Page 1 of 1 (latest)

verbal owl
#

I just create the project by following official doc. And run it with npm run start:dev. Command Run and Show me Detail in Terminal like this image.

import { Injectable } from '@nestjs/common';
@Injectable()
export class AppService {
 getHello(): string {
   return 'Hello World!';
 }
}

Than I change above getHello function in app.service.ts file from return 'Hello World' to retun 'Hello' like Below code. Change does not reflect after saving the file. And npm run start:dev command stuck

import { Injectable } from '@nestjs/common';

@Injectable()
export class AppService {
  getHello(): string {
    return 'Hello';
  }
}

command stuck image:
I also try stackoverflow solution but didn't work

hazy fog
#

nest info?

verbal owl
hazy fog
#

Can you run nest info as well

verbal owl
#

i am getting this

hazy fog
#

That's strange

mild linden
verbal owl
#

i am using cmd

hazy fog
#

And cmd gave you an error about powershell?

verbal owl
mild linden
#

okay nvm you did :v

hazy fog
#

Okay, that's bizarre. Huh.

#

My best guess here is that something weird is happening with Windows, because, well, Windows.

verbal owl
hazy fog
#

Can you check that tsc --watch works as expected?

verbal owl
#

i just follow these in other laptop its workinig. but my laptop its not working last day. I try with other node version. delete nodejs.

mild linden
verbal owl
#

ok

hazy fog
mild linden
#

so it's probably the windows Path env configuration, they don't have powershell path added to the list

hazy fog
verbal owl
#

Nest info work

hazy fog
#

Okay! Sorry to go through all the trouble for that, but glad that's working again

#

Can you run npx tsc --watch and start the tsc compiler in watch mode. Then make sure that it is compiling correctly and successfully restarting the compile process on change

verbal owl
#

ok

verbal owl
#

npm tsc --watch not working.

hazy fog
#

Okay, so it's a Typescript compiler issue, not an issue wtih Nest's CLI

#

Nest ends up calling tsc --watch under the hood and killing the node process on the old server while calling node dist/main on the newly compiled code

verbal owl
#

i am beginner.

hazy fog
#

Oh. npx tsc --watch

verbal owl
#

after above command

#

npx tsc --watch

hazy fog
#

And when you change a file it fully compiles correctly? (i,.e. the dist has the proper changes)

verbal owl
hazy fog
#

Okay, but the files in the dist have the right code, right?

verbal owl
#

yes. i did not chnage any code

hazy fog
#

Can you? So we can make sure the tsc --watch process is finishing

verbal owl
#

what shoul i have to do now

#

should*

hazy fog
#

Can you change the code, and verify that the correct output is in thedist

verbal owl
#

okay

#

yes its change

hazy fog
#

Okay, good. So something in thep rocess watcher is getting stuck/failing to restart the node process. I'll have to take time to look into this later

verbal owl
#

thanks. its my 3rd day on this issue.

#

i hope you will do something. again thanks.

hazy fog
#

Now, of course, I use Linux, so it's harder to debug a windows specific issue, but I'll try to do what I can when I have the time

verbal owl
#

@hazy fog hi, Is there any update about this issue?

hazy fog
#

Nope

verbal owl
#

is there any suggestion for me

#

what should i have to do

hazy fog
#

Other than use a Unix machine? No. This is something localized to your machine. We'll get the occasional Windows user say something about the restart not working, but the reports are few and far between that it seems its;' always something localized to the machine and not windows in general

verbal owl
#

reinstall windows might fix that issue??

hazy fog
#

maybe, again I really can't say ¯_(ツ)_/¯