Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'ng add @nguniversal/express-engine' not working

I am learning about angular universal. At this step :

ng add @nguniversal/express-engine --clientProject angular.io-example

It is supposed to add some files namely : main.server.ts, but it is not doing anything. I tried the same command with sudo too. What is the problem?

like image 298
Sunil Kumar Avatar asked Apr 13 '19 06:04

Sunil Kumar


1 Answers

FYI, I started off with a clean project so there indeed were dependencies missing, your case might be a bit different, depending on whether you already have some of the dependencies already installed.

Since it was doing the same for me too as mentioned, I went ahead and used

npm i @nguniversal/express-engine

which showed me some warnings about some dependencies which were missing.

In my case they were,

npm install ajv-keywords

and

npm install @angular/platform-server

then I ran

npm install @nguniversal/express-engine

to install the package, then

ng add @nguniversal/express-engine

which added the necessary dependencies you were asking for. Hope this is easy to follow

like image 93
sameerfair Avatar answered Jan 03 '23 17:01

sameerfair