1

I am facing a few issues while implementing the universal cli on existing angular 2 app by following the instruction from the link below https://universal.angular.io/quickstart/

On the first command to install angular-universal

npm install body-parser angular2-universal preboot express --save

I am getting the errors below

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN enoent ENOENT: no such file or directory, open 'C:\test-app\node_modules\node_modules\package.json'
npm WARN angular2-universal@2.1.0-rc.1 requires a peer of zone.js@~0.6.21 but none was installed.
npm WARN angular2-universal-polyfills@2.1.0-rc.1 requires a peer of zone.js@~0.6.21 but none was installed.

after executing the second command I am facing the errors listed below

/ Resolving "express" from "https://raw.githubusercontent.com/types/npm-express/40186271a77cdfad17681014be3ea8b05fc8dcf…- Resolving "mime" from "https://raw.githubusercontent.com/types/npm-mime/c7c5810698b7eaa421702a53644a8963d372f758/typi…\ Resolving "mime" from "https://raw.githubusercontent.com/types/npm-mime/c7c5810698b7eaa421702a53644a8963d372f758/typi…| Resolving "mime" from "https://raw.githubusercontent.com/types/npm-mime/c7c5810698b7eaa421702a53644a8963d372f758/typi…/ Resolving "mime" from "https://raw.githubusercontent.com/types/npm-mime/c7c5810698b7eaa421702a53644a8963d372f758/typi…- Resolving "mime" from "https://raw.githubusercontent.com/types/npm-mime/c7c5810698b7eaa421702a53644a8963d372f758/typi…\ Resolving "mime" from "https://raw.githubusercontent.com/types/npm-mime/c7c5810698b7eaa421702a53644a8963d372f758/typi…| Resolving "mime" from "https://raw.githubusercontent.com/types/npm-mime/c7c5810698b7eaa421702a53644a8963d372f758/typi…/ Resolving "mime" from "https://raw.githubusercontent.com/types/npm-mime/c7c5810698b7eaa421702a53644a8963d372f758/typi…- Resolving "mime" from "https://raw.githubusercontent.com/types/npm-mime/c7c5810698b7eaa421702a53644a8963d372f758/typi…\ Resolving "mime" from "https://raw.githubusercontent.com/types/npm-mime/c7c5810698b7eaa421702a53644a8963d372f758/typi…typings ERR! message Unable to find "node" ("npm") in the registry.
typings ERR! message However, we found "node" for 2 other sources: "dt" and "env"
typings ERR! message You can install these using the "source" option.
typings ERR! message We could use your help adding these typings to the registry: https://github.com/typings/registry
typings ERR! caused by https://api.typings.org/entries/npm/node/versions/latest responded with 404, expected it to equal 200
typings ERR!
typings ERR! cwd C:\test-app
typings ERR! system Windows_NT 10.0.14393
typings ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Ajackus Consultancy\\AppData\\Roaming\\npm\\node_modules\\typings\\dist\\bin.js" "install" "node" "express" "body-parser" "serve-static" "express-serve-static-core" "mime" "--global"
typings ERR! node -v v4.6.0
typings ERR! typings -v 2.1.0
typings ERR!
typings ERR! If you need help, you may report this error at:
typings ERR!   <https://github.com/typings/typings/issues>

what am i missing?

georgeawg
  • 48,608
  • 13
  • 72
  • 95
yaser
  • 159
  • 1
  • 2
  • 11

1 Answers1

4

Nothing, those are warnings, not errors. You can most likely safely ignore those. It happens when a dependency is installed after the dependant.

the usage of typings is kinda deprecated in favour of @types. Instead of those command execute these, and remove your local typings folder:

npm install --save-dev @types/node 
npm install --save-dev @types/express 
npm install --save-dev @types/body-parser 
npm install --save-dev @types/serve-static 
npm install --save-dev @types/express-serve-static-core 
npm install --save-dev @types/mime
Poul Kruijt
  • 69,713
  • 12
  • 145
  • 149
  • but how do i ensure whether angular2-universal has been installed? – yaser Jan 31 '17 at 08:41
  • check node_modules folder if there is a folder `angular2-universal` – Poul Kruijt Jan 31 '17 at 08:51
  • yes it is there but now after executing the second command from tutorial i am getting the error listed below, perhaps you can help with that too. – yaser Jan 31 '17 at 09:48
  • I am still facing an issue when i try to run node server.js – yaser Jan 31 '17 at 10:07
  • import 'angular2-universal/polyfills'; ^^^^^^ SyntaxError: Unexpected reserved word at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module.runMain (module.js:441:10) at startup (node.js:139:18) at node.js:974:3 – yaser Jan 31 '17 at 10:07
  • @yaser guide from https://universal.angular.io/quickstart/ has a lot of gotchas and i think it's kinda outdated. I suggest to follow https://github.com/angular/universal-starter – DDRamone Jan 31 '17 at 10:10
  • @DDRamone Thanks! – yaser Jan 31 '17 at 10:15