2

I am creating new angular monorepo application, I run following command:

npx create-nx-workspace explorer --preset=angular

but I am getting following error once it executes:

√ Installing dependencies with npm
× Creating your workspace in explorer

 >  NX   Nx failed to create a workspace.

   Exit code: 1
   Log file: C:\Users\xxx\AppData\Local\Temp\tmp-21320-9eV8hcpfQJm2\error.log

File logs are as follows:

2590 error invalid json response body at typescript-estree reason: Unexpected end of JSON input
2591 verbose exit 1

Is it because I am behind company's VPN or do I need to do something to handle it?

Thanks in advance.

Vikas Kad
  • 1,013
  • 1
  • 18
  • 38
  • Most likely because of company firewall. Have you tried without? –  Mar 24 '23 at 10:39
  • I just tried but still same error. – Vikas Kad Mar 24 '23 at 10:40
  • 1
    Maybe this? https://letscodepare.com/blog/npm-err-invalid-json-response-body-unexpected-end-of-json-input –  Mar 24 '23 at 10:40
  • 1
    There's also this answer https://stackoverflow.com/questions/64625539/npm-err-invalid-json-response-body-at-http-registry-npmjs-org-ansi-escapes-re –  Mar 24 '23 at 10:44
  • Did you tried to start simple npx create-nx-workspace and set up the configs during the setup ? – Stefani Toto Mar 24 '23 at 12:28

1 Answers1

1

I am able to fix it using following commands:

 npm cache clean --force

npm config rm proxy

npm config rm https-proxy

npm cache verify

And once it is able to run then again I added my org's proxy config again.

Also, Comment the .npmrc file as well

Vikas Kad
  • 1,013
  • 1
  • 18
  • 38