quentinlampin / ngx-openlayers

Angular2+ components for Openlayers 4.x
Mozilla Public License 2.0
137 stars 98 forks source link

Build fail with angular-cli 1.0 #58

Closed lautarobock closed 7 years ago

lautarobock commented 7 years ago

I have no problem with angular-cli@beta, but after update to 1.0 I cant bui;d. Here a repo with a project that reproduce https://github.com/lautarobock/angular2-openlayers-bug

$ git clone https://github.com/lautarobock/angular2-openlayers-bug.git
$ cd angular2-openlayers-bug
$ npm install
$ ng build

ERROR in C:/Dev/WebDocuments/Field/testWithMap/node_modules/angular2-openlayers/dist/components/map.component.d.ts (1,1): Cannot find type definition file for 'openlayers'.

ERROR in C:/Dev/WebDocuments/Field/testWithMap/node_modules/angular2-openlayers/dist/components/controls/attribution.component.d.ts (1,1): Cannot find type definition file for 'openlayers'.

and more, please see in https://github.com/lautarobock/angular2-openlayers-bug/blob/master/README.md

lautarobock commented 7 years ago

Responding to myself,

npm install --save @types/openlayers
quentin-ol commented 7 years ago

'''npm install''' without argument install all dependencies, including those listed as devDependencies. I've looked at '''package.json''' and it does list '''@types/openlayers'''. Weird that you had to manually issue an '''npm install''' command.

lautarobock commented 7 years ago

sorry, when I sayd "responding to me" and closing the issue I mean that is solved :)

quentin-ol commented 7 years ago

Hey @lautarobock, the thing is the way you solved the issue should not make a difference, actually. the npm install command should have installed this package already. The command that you report as solution is redundant, hence my comment. Anyways, as you said, it's solved, so great! Happy coding with angular2-openlayers!

lautarobock commented 7 years ago

hey @quentin-ol doing npm install angular2-openlayers should install openlayers and `@types/openlayers' too? not in my case

boom235 commented 7 years ago

@quentin-ol I just had the exact same problem. After installing angular2-openlayers via npm I had to install openlayers (not sure if this helped solving the problem) and @types/openlayers. The last install of @types/openlayers definently solved the problem.

pieterdb4477 commented 7 years ago

This also solves my problem mentioned in #81