0

I was having a problem when converting my Angular App into Angular Universal. I'm running this command " ng add @nguniversal/express-engine --clientProject my-app"

An unhandled exception occurred: Cannot find module '@schematics/angular/utility/json-file' Require stack:

  • C:\Projects\my-app\node_modules@nguniversal\common\schematics\add\index.js
  • C:\Projects\my-app\node_modules@nguniversal\express-engine\schematics\install\index.js
  • C:\Projects\my-app\node_modules@angular-devkit\schematics\tools\export-ref.js
  • C:\Projects\my-app\node_modules@angular-devkit\schematics\tools\index.js
  • C:\Projects\my-app\node_modules@angular\cli\utilities\json-schema.js
  • C:\Projects\my-app\node_modules@angular\cli\models\command-runner.js
  • C:\Projects\my-app\node_modules@angular\cli\lib\cli\index.js
  • C:\Users\Administrator\AppData\Roaming\npm\node_modules@angular\cli\lib\init.js
  • C:\Users\Administrator\AppData\Roaming\npm\node_modules@angular\cli\bin\ng

Already checked the net but I can't see any error that is exactly the same as mine.

1 Answer 1

2

I suspect this is an issue with Angular CLI version. Projects created with angular/cli v9 or 10 don’t have this file, but project created with angular/cli v11 have this file.

I copied the files (json-file.js, json-file.d.ts) from a v11 project to a v10 project, and the command works fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.