Solvedangular cli Missing typings directory

I got a broccoli/funnel error due to a missing typings directory

OS: Fresh Arch Linux (inside nspawn)
Versions:
angular-cli: 0.0.39
node: 6.0.0
npm: 3.8.8
Reproduce:

ng new proj

cd proj

ng serve

Observed Behaviour:
ng serve
(node:5196) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
The Broccoli Plugin: [Funnel] failed with:
Error: Attempting to watch missing directory: typings
at EventEmitter.Watcher_addWatchDir as addWatchDir
at /.../node_modules/angular-cli/node_modules/angular-cli/node_modules/angular-cli-broccoli/lib/builder.js:95:35
at lib$rsvp$$internal$$tryCatch (/.../node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/.../node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
at /.../node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:331:11
at lib$rsvp$asap$$flush (/.../node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)

The broccoli plugin was instantiated at:
at Funnel.Plugin (/.../node_modules/angular-cli/node_modules/broccoli-funnel/node_modules/broccoli-plugin/index.js:7:31)
at new Funnel (/.../node_modules/angular-cli/node_modules/broccoli-funnel/index.js:44:10)
at Angular2App._buildInputTree (/.../node_modules/angular-cli/lib/broccoli/angular2-app.js:74:7)
at new Angular2App (/.../node_modules/angular-cli/lib/broccoli/angular2-app.js:31:41)
at module.exports (/.../angular-cli-build.js:6:10)
at Class.module.exports.Task.extend.setupBroccoliBuilder (/.../node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:55:19)
at Class.module.exports.Task.extend.init (/.../node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:89:10)
at new Class (/.../node_modules/angular-cli/node_modules/angular-cli/node_modules/core-object/core-object.js:18:12)
at Class.module.exports.Task.extend.run (/.../node_modules/angular-cli/node_modules/angular-cli/lib/tasks/serve.js:15:19)
at /.../node_modules/angular-cli/node_modules/angular-cli/lib/commands/serve.js:64:24
at lib$rsvp$$internal$$tryCatch (/.../node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/.../node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
at /.../node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:331:11
at lib$rsvp$asap$$flush (/.../node_modules/angular-cli/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)

Expected Behaviour:
Don't fail.

14 Answers

✔️Accepted Answer

Yea postinstallis not running for some reason on OSX either.
A quick fix is to just do npm run postinstall manually in the root of your project directory.
You should not need to install typings globally as it is being installed as an angular-cli dependency (at least for me).

Other Answers:

Probably because the scaffolding process didn't install the typings. Normally that should be a postinstall but it happens to me as well sometimes... I normally have the repo cloned locally and use that with npm link. Whenever I work on Ubuntu, after creating a new project I have to cd into it and do npm link angular-cli. That's when the postinstall never fires, but only on Ubuntu. (I don't know why but I don't care either).
All you need to do is cd inside your project root directory and typings install.

I'm experiencing the exact same error on OSX.
@monojack: the typings directory doesn't exist, however "typings install" is not a known command for me, would you kindly explain more please? thanks

This is probably a permissions thing on your machine. See #389 (comment).

To fix on OSX I installed node via brew (so I wouldn't have to run it as sudo).
Before you install angular-cli, if you had previously installed node as sudo you will have to make sure you remove ~/.config/configsore/ember-cli.json, ~/.config/configsore/typings.json, and ~/.config/configsore/update-notifier-typings.json. This is because we do not want the owner of these files to be root.

More Issues: