locana-co / PGRestAPI

Node.js REST API for PostGres Spatial Entities. AKA: SpatialServer
Apache License 2.0
436 stars 75 forks source link

PGRestAPI windows installation ok, but failed to run. #132

Open hoogw opened 8 years ago

hoogw commented 8 years ago

I follow the windows installation guide,

I installed mapnik for windows 32 bit as guide and test it with pyhton.exe
import mapnik without any error, means mapnik and python successfully installed on windows.

Then install PGRestAPI as guide, I do not see folder node-mapnik under node_modules, but see folder mapnik-reference

when I run : node app.js I got error:

C:\jh\PGRestAPI>node app.js

module.js:340 throw err; ^ Error: Cannot find module 'mapnik' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (C:\jh\PGRestAPI\utils\sphericalmercator.js:1:76) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

C:\jh\PGRestAPI>

Please help.

apollolm commented 8 years ago

Hi - did you run npm install? It looks like the node-mapnik module is missing in the installation. Were you able to get Mapnik installed on your Windows machine?

hoogw commented 8 years ago

apollolm,

Good advise, I do not have a node-mapnik module.

I only install Mapnik on windows as guide. Seem it is NOT good enough, I am try to install node-mapnik on windows, but not yet success.

Install node-mapnik on windows is such a pain,

I am stuck in this windows builds, don't know how to do it.

https://github.com/mapbox/windows-builds

Do you have any hint?

I think PGRestAPI is not going to run without node-mapnik on windows.

hoogw commented 8 years ago

apollolm,

PGRestAPI run on windows is a nice things, but I spend a week failed to figure out.

have you try successfully install node-mapnik on windows? will the PGRestAPI run good with mapnik?

PGRestAPI itself is a revolution invent, it has potential to beat esri arcgis server on the market in future. I do believe it comes in some days. But first things first, I need to install node-mapnik.

hoogw commented 8 years ago

After 5 days try and fail, today, I am getting closer to success.

Some tips:

You MUST installed as default directory( if you choose other install directory could fail )

I am on 64bit operating system (W7, 8, 8.1, Server 2012)

1) Visual Studio 2015, earlier versions, is NOT ok, https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx (direct download)

2) Python 2.7 32 bit installed into C:\Python27 (MUST be this directory, MUST be 32 bit) other directory or 64 bit could fail you.

3) git installed into C:\Program Files (x86)\Git (MUST be this directory, Must be 32 bit) Install Node.js MUST be 32 bit, into C:\Program Files (x86)\nodejs\ must be this directory. Otherwise, could error, not sure why

4) install mapnik for windows, Verify the success by run demo python script to generate a bunch of image file as says in guide. (Must verify the success)

5)Now install PGrestAPI, I still get error, but it much closer to success.

`Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\windows\system32>cd C:\jh\PGRestAPI

C:\jh\PGRestAPI>npm install npm WARN deprecated less-middleware@0.1.14: Updated API and improved functionali ty. npm WARN deprecated jade@0.35.0: Jade has been renamed to pug, please install th e latest version of pug instead of jade npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install th e latest version of pug instead of jade npm WARN deprecated graceful-fs@2.0.3: graceful-fs version 3 and before will fai l on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possibl e. npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fai l on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possibl e. |

contextify@0.1.15 install C:\jh\PGRestAPI\node_modules\jsdom\node_modules\cont extify node-gyp rebuild

/ C:\jh\PGRestAPI\node_modules\jsdom\node_modules\contextify>node "C:\Program File s (x86)\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bi n\node-gyp.js" rebuild gyp ERR! configure error gyp ERR! stack Error: spawn ENOENT gyp ERR! stack at errnoException (child_process.js:1011:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:802: 34) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\nod e_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\jh\PGRestAPI\node_modules\jsdom\node_modules\contextify gyp ERR! node -v v0.10.36 gyp ERR! node-gyp -v v1.0.1

gyp ERR! not ok

pg@3.4.0 install C:\jh\PGRestAPI\node_modules\pg node-gyp rebuild || (exit 0)

\ C:\jh\PGRestAPI\node_modules\pg>node "C:\Program Files (x86)\nodejs\node_modules \npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild gyp ERR! configure error gyp ERR! stack Error: spawn ENOENT gyp ERR! stack at errnoException (child_process.js:1011:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:802: 34) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\nod e_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\jh\PGRestAPI\node_modules\pg gyp ERR! node -v v0.10.36 gyp ERR! node-gyp -v v1.0.1 gyp ERR! not ok \

srs@0.3.12 install C:\jh\PGRestAPI\node_modules\millstone\node_modules\srs node-gyp rebuild

C:\jh\PGRestAPI\node_modules\millstone\node_modules\srs>node "C:\Program Files ( x86)\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\n ode-gyp.js" rebuild gyp ERR! configure error gyp ERR! stack Error: spawn ENOENT gyp ERR! stack at errnoException (child_process.js:1011:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:802: 34) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\nod e_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\jh\PGRestAPI\node_modules\millstone\node_modules\srs gyp ERR! node -v v0.10.36 gyp ERR! node-gyp -v v1.0.1

gyp ERR! not ok

mapnik@1.4.15 install C:\jh\PGRestAPI\node_modules\mapnik node-pre-gyp install --fallback-to-build

[mapnik] Success: "C:\jh\PGRestAPI\node_modules\mapnik\lib\binding\node-v11-win3 2-ia32\mapnik.node" is installed via remote npm WARN deprecated set-immediate@0.1.1: Use setimmediate instead

sqlite3@2.2.7 install C:\jh\PGRestAPI\node_modules\millstone\node_modules\sqli te3 node-pre-gyp install --fallback-to-build

C:\jh\PGRestAPI\node_modules\millstone\node_modules\sqlite3>node "C:\Program Fil es (x86)\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\b in\node-gyp.js" rebuild --name=sqlite3 --configuration=Release --module_name=nod e_sqlite3 --version=2.2.7 --major=2 --minor=2 --patch=7 --runtime=node --node_ab i=node-v11 --platform=win32 --target_platform=win32 --arch=ia32 --target_arch=ia 32 --module_main=./lib/sqlite3 --host=https://mapbox-node-binary.s3.amazonaws.co m/ --module_path=C:\jh\PGRestAPI\node_modules\millstone\node_modules\sqlite3\lib \binding\node-v11-win32-ia32 --remote_path=./sqlite3/v2.2.7/ --package_name=node -v11-win32-ia32.tar.gz --staged_tarball=build\stage\sqlite3\v2.2.7\node-v11-win3 2-ia32.tar.gz --hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/ v2.2.7/ --hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v2. 2.7/node-v11-win32-ia32.tar.gz

C:\jh\PGRestAPI\node_modules\millstone\node_modules\sqlite3>node "C:\Program Fil es (x86)\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\b in\node-gyp.js" rebuild --name=sqlite3 --configuration=Release --module_name=nod e_sqlite3 --version=2.2.7 --major=2 --minor=2 --patch=7 --runtime=node --node_ab i=node-v11 --platform=win32 --target_platform=win32 --arch=ia32 --target_arch=ia 32 --module_main=./lib/sqlite3 --host=https://mapbox-node-binary.s3.amazonaws.co m/ --module_path=C:\jh\PGRestAPI\node_modules\millstone\node_modules\sqlite3\lib \binding\node-v11-win32-ia32 --remote_path=./sqlite3/v2.2.7/ --package_name=node -v11-win32-ia32.tar.gz --staged_tarball=build\stage\sqlite3\v2.2.7\node-v11-win3 2-ia32.tar.gz --hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/ v2.2.7/ --hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v2. 2.7/node-v11-win32-ia32.tar.gz gyp ERR! configure error gyp ERR! stack Error: spawn ENOENT gyp ERR! stack at errnoException (child_process.js:1011:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:802: 34) gyp gyp ERR! ERR!System Windows_NT 6.1.7601 configure error gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\nod e_modules\node-gyp\bin\node-gyp.js" "rebuild" "--name=sqlite3" "--configurati on=Release" "--module_name=node_sqlite3" "--version=2.2.7" "--major=2" "--minor= 2" "--patch=7" "--runtime=node" "--node_abi=node-v11" "--platform=win32" "--targ et_platform=win32" "--arch=ia32" "--target_arch=ia32" "--module_main=./lib/sqlit e3" "--host=https://mapbox-node-binary.s3.amazonaws.com/" "--module_path=C:\jh\ \PGRestAPI\node_modules\millstone\node_modules\sqlite3\lib\binding\node-v 11-win32-ia32" "--remote_path=./sqlite3/v2.2.7/" "--package_name=node-v11-win32- ia32.tar.gz" "--staged_tarball=build\stage\sqlite3\v2.2.7\node-v11-win32-ia3 2.tar.gz" "--hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v2. 2.7/" "--hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v2.2 .7/node-v11-win32-ia32.tar.gz" gyp gypERR! stackERR! cwd C:\jh\PGRestAPI\node_modules\millstone\node_modules\s qlite3 Error: spawn ENOENT gyp gyp ERR! ERR! stack at errnoException (child_process.js:1011:11) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:802: 34) gyp ERR! node -v v0.10.36 System Windows_NT 6.1.7601 gyp ERR! node-gyp -vgyp v1.0.1 gypERR! commandERR! "node" "C:\Program Files (x86)\nodejs\node_modules\npm \node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--name=sqlite3" "--config uration=Release" "--module_name=node_sqlite3" "--version=2.2.7" "--major=2" "--m inor=2" "--patch=7" "--runtime=node" "--node_abi=node-v11" "--platform=win32" "- -target_platform=win32" "--arch=ia32" "--target_arch=ia32" "--module_main=./lib/ sqlite3" "--host=https://mapbox-node-binary.s3.amazonaws.com/" "--module_path=C: \jh\PGRestAPI\node_modules\millstone\node_modules\sqlite3\lib\binding\n ode-v11-win32-ia32" "--remote_path=./sqlite3/v2.2.7/" "--package_name=node-v11-w in32-ia32.tar.gz" "--staged_tarball=build\stage\sqlite3\v2.2.7\node-v11-win3 2-ia32.tar.gz" "--hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite 3/v2.2.7/" "--hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3 /v2.2.7/node-v11-win32-ia32.tar.gz" not okgyp ERR! cwd C:\jh\PGRestAPI\node_modules\millstone\node_modules\sqlite3 gyp ERR! node -v v0.10.36 gyp ERR! node-gyp -v v1.0.1 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd rebuild --name=sq lite3 --configuration=Release --module_name=node_sqlite3 --version=2.2.7 --major =2 --minor=2 --patch=7 --runtime=node --node_abi=node-v11 --platform=win32 --tar get_platform=win32 --arch=ia32 --target_arch=ia32 --module_main=./lib/sqlite3 -- host=https://mapbox-node-binary.s3.amazonaws.com/ --module_path=C:\jh\PGRestAPI\ node_modules\millstone\node_modules\sqlite3\lib\binding\node-v11-win32-ia32 --re mote_path=./sqlite3/v2.2.7/ --package_name=node-v11-win32-ia32.tar.gz --staged_t arball=build\stage\sqlite3\v2.2.7\node-v11-win32-ia32.tar.gz --hosted_path=https ://mapbox-node-binary.s3.amazonaws.com/sqlite3/v2.2.7/ --hosted_tarball=https:// mapbox-node-binary.s3.amazonaws.com/sqlite3/v2.2.7/node-v11-win32-ia32.tar.gz' ( 1) node-pre-gyp ERR! stack at ChildProcess. (C:\jh\PGRestAPI\node_mo dules\millstone\node_modules\sqlite3\node_modules\node-pre-gyp\lib\util\compile. js:76:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17) node-pre-gyp ERR! stack at maybeClose (child_process.js:766:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_proces s.js:833:5) node-pre-gyp ERR! System Windows_NT 6.1.7601 node-pre-gyp ERR! command "node" "C:\jh\PGRestAPI\node_modules\millstone\no de_modules\sqlite3\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "- -fallback-to-build" node-pre-gyp ERR! cwd C:\jh\PGRestAPI\node_modules\millstone\node_modules\sqlite 3 node-pre-gyp ERR! node -v v0.10.36 node-pre-gyp ERR! node-pre-gyp -v v0.5.22 node-pre-gyp ERR! not ok Failed to execute 'node-gyp.cmd rebuild --name=sqlite3 --configuration=Release - -module_name=node_sqlite3 --version=2.2.7 --major=2 --minor=2 --patch=7 --runtim e=node --node_abi=node-v11 --platform=win32 --target_platform=win32 --arch=ia32 --target_arch=ia32 --module_main=./lib/sqlite3 --host=https://mapbox-node-binary .s3.amazonaws.com/ --module_path=C:\jh\PGRestAPI\node_modules\millstone\node_mod ules\sqlite3\lib\binding\node-v11-win32-ia32 --remote_path=./sqlite3/v2.2.7/ --p ackage_name=node-v11-win32-ia32.tar.gz --staged_tarball=build\stage\sqlite3\v2.2 .7\node-v11-win32-ia32.tar.gz --hosted_path=https://mapbox-node-binary.s3.amazon aws.com/sqlite3/v2.2.7/ --hosted_tarball=https://mapbox-node-binary.s3.amazonaws .com/sqlite3/v2.2.7/node-v11-win32-ia32.tar.gz' (1)

zipfile@0.5.9 install C:\jh\PGRestAPI\node_modules\millstone\node_modules\zipf ile node-pre-gyp install --fallback-to-build

[zipfile] Success: "C:\jh\PGRestAPI\node_modules\millstone\node_modules\zipfile\ lib\binding\node-v11-win32-ia32\zipfile.node" is installed via remote

sqlite3@2.2.7 install C:\jh\PGRestAPI\node_modules\mbtiles\node_modules\sqlite 3 node-pre-gyp install --fallback-to-build

[sqlite3] Success: "C:\jh\PGRestAPI\node_modules\mbtiles\node_modules\sqlite3\li b\binding\node-v11-win32-ia32\node_sqlite3.node" is installed via remote npm ERR! contextify@0.1.15 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the contextify@0.1.15 install script. npm ERR! This is most likely a problem with the contextify package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls contextify npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program File s (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR! cwd C:\jh\PGRestAPI npm ERR! node -v v0.10.36 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! not ok code 0

C:\jh\PGRestAPI>node app.js Mapnik module has an error. Skipping this module. Reason: Error: Cannot find mod ule 'millstone' SpatialServer listening on port 3001 Error in reading spatial tables from DB. Can't load dynamic tile endopints. Mes sage is: undefined

events.js:72 throw er; // Unhandled 'error' event ^ Error: read ECONNRESET at errnoException (net.js:905:11) at TCP.onread (net.js:559:19)

C:\jh\PGRestAPI>`

hoogw commented 8 years ago

How to use it?

I get message: SpatialServer listening on port 3001

But why I use browser do http://localhost:3001, says can't not open

Is it really running or it error out ?

hoogw commented 8 years ago

I think the node-mapnik issue are solved by my tips (above). But comes other issue, can you give me some direction?