- I used Angular CLI to generate an app.
- Ran "npm install angular2-jwt" in the terminal
Added the script reference to angular-cli.json:
"scripts":[ ... "../node_modules/angular2-jwt/angular2-jwt.js" ... ]
Ran "ng serve" No problems so far
- But if I browse to http://localhost:4200 I get:
caught ReferenceError: require is not defined at scripts.bundle.js:224 (anonymous) @ scripts.bundle.js:224
I don't want to keep implementing angular2-JWT with this error around. How can I fix this?