ngageoint / geopackage-js

GeoPackage JavaScript Library
http://ngageoint.github.io/geopackage-js/
MIT License
308 stars 78 forks source link

NPM ERR: ngageoint/leaflet-geopackage is giving build error.. #156

Closed KumarR18 closed 4 years ago

KumarR18 commented 4 years ago

Getting below error while installing @ngageoint/leaflet-geopackage. Please help

C:\BASF\Raushan\AgInsights\FE\mtz-web-ui>npm i @ngageoint/leaflet-geopackage

integer@1.0.7 install C:\BASF\Raushan\AgInsights\FE\mtz-web-ui\node_modules\@ngageoint\leaflet-geopackage\node_modules\integer node-gyp rebuild

C:\BASF\Raushan\AgInsights\FE\mtz-web-ui\node_modules\@ngageoint\leaflet-geopackage\node_modules\integer>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. integer.cpp win_delay_load_hook.cc c:\basf\raushan\aginsights\fe\mtz-web-ui\node_modules\@ngageoint\leaflet-geopackage\node_modules\integer\src\integer.cp p(329): error C2664: 'v8::String::Value::Value(const v8::String::Value &)': cannot convert argument 1 from 'v8::Local<v 8::String>' to 'const v8::String::Value &' [C:\BASF\Raushan\AgInsights\FE\mtz-web-ui\node_modules\@ngageoint\leaflet-ge opackage\node_modules\integer\build\integer.vcxproj] c:\basf\raushan\aginsights\fe\mtz-web-ui\node_modules\@ngageoint\leaflet-geopackage\node_modules\integer\src\integer. cpp(329): note: Reason: cannot convert from 'v8::Local' to 'const v8::String::Value' c:\basf\raushan\aginsights\fe\mtz-web-ui\node_modules\@ngageoint\leaflet-geopackage\node_modules\integer\src\integer. cpp(329): note: No user-defined-conversion operator available that can perform this conversion, or the operator canno t be called c:\basf\raushan\aginsights\fe\mtz-web-ui\node_modules\@ngageoint\leaflet-geopackage\node_modules\integer\src\integer.cp p(370): warning C4804: '-': unsafe use of type 'bool' in operation [C:\BASF\Raushan\AgInsights\FE\mtz-web-ui\node_modul es\@ngageoint\leaflet-geopackage\node_modules\integer\build\integer.vcxproj] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\BASF\Raushan\AgInsights\FE\mtz-web-ui\node_modules\@ngageoint\leaflet-geopackage\node_modules\integer gyp ERR! node -v v14.4.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! integer@1.0.7 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the integer@1.0.7 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\KumarR18\AppData\Roaming\npm-cache_logs\2020-06-29T12_29_19_221Z-debug.log

danielbarela commented 4 years ago

It looks like there is an error building the integer library. You will need to have the proper dependencies installed to build that library. You should be able to create a new folder and type npm install integer to see the errors.

KumarR18 commented 4 years ago

@danielbarela , it seems some conversion issue in library itself. Could you please do npm i @ngageoint/leaflet-geopackage and let me know the results. I have tried several times and got it stuck here

danielbarela commented 4 years ago

I was able to build leaflet-geopackage, however, I have all of the C++ libraries installed to build the integer library.

The issue is that the integer library did not have the prebuilt libraries for your version of node. I just released a new version of leaflet-geopackage and geopackage which upgrade the integer library.

Please try with version 3.0.1 of leaflet-geopackage.

KumarR18 commented 4 years ago

@danielbarela , Thank you so much...now build issue is resolved.

But after implementating it, I am getting below error on library. leaflet-geopackage.js:178 Uncaught TypeError: GeoPackageAPI.openGeoPackageByteArray is not a function at XMLHttpRequest.xhr.onload (leaflet-geopackage.js:178)

image

It will be very helpful if you could help here

danielbarela commented 4 years ago

@KumarR18 sorry about that, I pushed a new version 3.0.2 that fixes that call.

KumarR18 commented 4 years ago

@danielbarela , Thank you, but now getting different error :(

leaflet-geopackage.js:185 Uncaught (in promise) TypeError: Assignment to constant variable. at leaflet-geopackage.js:185 image

danielbarela commented 4 years ago

OK. It's really fixed this time. For real. 3.0.3. Thanks for being patient.

KumarR18 commented 4 years ago

@danielbarela , Thank you so much. It is working now.

one comment is there, currently geopackage is using canvas 2.6.0 version and to install it, requires lots of manual setup. Instead of latest canvas version 2.6.1 doesn't have this issue.

Anyways, Thank you so much for your quick help. 👍

danielbarela commented 4 years ago

Awesome, glad it is working, sorry for not finding those bugs in the first place. I will modify the version of canvas in the next release of the library.

KumarR18 commented 4 years ago

@danielbarela ,

Hi Daniel,

It seems this library is throwing error for IE Edge. In Chrome it is working fine. image

Only this is the log I have. If you could help here.

Thanks in advance

KumarR18 commented 4 years ago

@danielbarela , Sorry but issue is resolved now. :)

Thank you