haoliangyu/ngx-leaflet-starter

rxjs dependency problem

eforte opened this issue · 3 comments

When running npm install the following warnings appear:

├─┬ UNMET PEER DEPENDENCY rxjs@5.0.0-rc.1

npm WARN @angular/http@2.0.0 requires a peer of rxjs@5.0.0-beta.12 but none was installed.
npm WARN @angular/core@2.0.0 requires a peer of rxjs@5.0.0-beta.12 but none was installed.

Then when when running webpack the following errors (related to the warning above) occur:

ERROR in /Users/franciscoojeda/code/angular2-leaflet-starter/node_modules/rxjs/operator/mergeMap.d.ts
(56,40): error TS1138: Parameter declaration expected.

ERROR in /Users/franciscoojeda/code/angular2-leaflet-starter/node_modules/rxjs/operator/mergeMap.d.ts
(56,44): error TS1005: ';' expected.

... many more of these errors here

These are the node and npm versions:

node -v
v6.2.1

npm -v
3.9.3

How can I get "npm install" to build the project?

Thanks

Thanks for reporting the issue. It turns out that the latest version 5.0.0-rc.1 of rxjs doesn't work well in TypeScript. I have downgraded the version at package.json. You can change line 38 at package.json from

"rxjs": "^5.0.0-beta.12"

to

// delete the ^
"rxjs": "5.0.0-beta.12"

and reinstall the dependency.

If you want to use npm install to do the project build as well, you can probably use the postinstall npm script to run webpack command. So that it will build immediately after npm install.

Marked as resolved. Please let me know if you have any other problem.

@haoliangyu thanks for your help. It worked out well after following your advice.