Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Bindings #19

Open
mishra123 opened this issue Feb 8, 2018 · 9 comments
Open

Node Bindings #19

mishra123 opened this issue Feb 8, 2018 · 9 comments

Comments

@mishra123
Copy link

I have set up the installation files on windows and I am able to run it using command line utility. But the problem is when I set up the node bindings with "npm install openvenues/node-postal", it gives me stack of error messages. Please see below:

\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\no
de-gyp.js" rebuild ) else (node "C:\Roaming\npm\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.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:
\Libpostal\libpostal\src\node_modules\node-postal\build\expand.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error
MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:
\Libpostal\libpostal\src\node_modules\node-postal\build\parser.vcxproj]

gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp
lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\AppData\Roaming\npm\node_modules\npm\
ode_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Libpostal\libpostal\src\node_modules\node-postal
gyp ERR! node -v v6.11.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN saveError ENOENT: no such file or directory, open 'C:\Libpostal\libpostal\src\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Libpostal\libpostal\src\package.json'
npm WARN src No description
npm WARN src No repository field.
npm WARN src No README data
npm WARN src No license field.

Can you help me resolve the error?

@albarrentine
Copy link
Contributor

node-postal has only been tested on Mac and Linux, not Windows. Support for Windows was only recently added in the libpostal C library (has to be compiled with MSYS2), but not sure if node-postal would work unmodified. If you get it working, please feel free to make a pull request. Otherwise it's best to use a Linux VM or container if possible.

@mishra123
Copy link
Author

Now, I am doing it on Amazon EC2 Linux. when I run "npm install openevenues/libpostal", it gave me the following error:

node-postal@1.0.0 install /home/ec2-user/libpostal/node_modules/node-postal
(node-gyp rebuild) || (exit 0)

make: Entering directory /home/ec2-user/libpostal/node_modules/node-postal/build' CXX(target) Release/obj.target/expand/src/expand.o ../src/expand.cc:1:33: fatal error: libpostal/libpostal.h: No such file or directory #include <libpostal/libpostal.h> ^ compilation terminated. make: *** [Release/obj.target/expand/src/expand.o] Error 1 make: Leaving directory /home/ec2-user/libpostal/node_modules/node-postal/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.9.38-16.35.amzn1.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ec2-user/libpostal/node_modules/node-postal
gyp ERR! node -v v4.6.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-postal@1.0.0 node_modules/node-postal
âââ bindings@1.3.0
âââ nan@2.8.0

How shall I resolve this?

@albarrentine
Copy link
Contributor

Make sure to install libpostal first, as mentioned in the README. It’s not currently possible to install node-postal with one command. The C library needs to be installed separately.

@mishra123
Copy link
Author

mishra123 commented Feb 10, 2018

Yeah I have installed libpostal on EC2 before setting up node-postal. I have followed the following steps:

  1. sudo yum install curl autoconf automake libtool pkgconfig
  2. git clone https://github.com/openvenues/libpostal
    cd libpostal
    ./bootstrap.sh
    ./configure --datadir=[...some dir with a few GB of space...]
    make -j4
    sudo make install

sudo ldconfig

  1. sudo npm install -g node-gyp

  2. npm install openvenues/node-postal - This is the step where the error in the previous post was occurred.

I am actually setting up AWS Lambda with node-libpostal. I am deploying the executables from EC2 on to S3 bucket which will be executed by Lambda. But I cannot go any further as I am stuck with step 4 above.
Please help me with this.

@nk-gears
Copy link

nk-gears commented Oct 1, 2018

Hi @mishra123 , Were you able to find a solution for running the libpostal in AWS lambda?

@RayRenteria
Copy link

Hi @mishra123 , I too am interested in hearing about your efforts in deploying libpostal onto AWS Lambda.

@danielmklein
Copy link

Hello all -- I stumbled upon this while trying to deploy a Lambda function that uses pypostal and just wanted to chime in (with some bad news). It appears to me that, it's not going to be possible to deploy code that uses libpostal to AWS Lambda, barring something I'm missing or not understanding. This is given that Lambda's 250MB cap for deployment packages (including function code and all layers) and that libpostal appears to blow up if the data directory is not present. In my testing, I see my data directory taking up almost 2GB.

I would love to be proven wrong here! If anyone out there has any tips for working around this, I am all ears.

@bonespiked
Copy link

With the new EFS and Fargate integration, this should at least be possible now - whether you'd want the data dir effectively NFS mounted is another story alltogether though....

@CaseGuide
Copy link

With the new EFS and Fargate integration, this should at least be possible now - whether you'd want the data dir effectively NFS mounted is another story alltogether though....

Could you elaborate a bit on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants