Deploying Node.js app with gdal | AWS Elastic Beanstalk - node.js

I'm trying to deploy a node.js app but get stuck with an error about missing dependencies for gdal.
Error: /lib64/libm.so.6: version 'GLIBC_2.27' not found (required by /var/app/current/node_modules/gdal/lib/binding/gdal.node)
How would I go about installing this required dependency?

gdal-async on npm explicitly supports AWS.
As its author, I will be happy to help you if it doesn't work - you can create an issue on github.
I don't know what you call gdal.js.
There is the original gdal by Mapbox and Natural Atlas that is not actively developed anymore.
There is gdal-next on which I used to work a little bit which has a current version of GDAL but it is not very active either.
There is my gdal-async which is the only one that is currently active.
And there is an Emscripten port that is pure JS and runs in the browser, but it is stalled at GDAL 2.
Supporting AWS is simply a matter of compiling with the right libraries.

Related

Something went wrong installing the "sharp" module, on Mac M1

I had been trying to resolve this issue and had tried running the app via rosetta terminal, but same issue persists. I tried installing the sharp package globally but that to did not help.
Here is a snippet of the error :-
I think the issue is something related to Sharp package specific for the arm architecture
I was trying to setup a repo on my system locally and simply ran yarn dev. I expected the server to start but the same error keeps coming again and again .
I think your problem is related to this conversation: https://github.com/lovell/sharp/pull/3514
Specifically "On an M1/M2 based machine, the dylib files provided by a globally-installed vips (via Homebrew or otherwise) will be ARM64, therefore we cannot use these when running Node.js under x64 emulation as there will be a runtime conflict."

How to update (nodejs14.x) while having node version v16.14.2?

I am beginner in node trying to create rest-api's using node and express. Following the udemy course https://www.udemy.com/course/create-a-rest-api-with-node-js-and-mongo-db/.
In this turbo server is used and site is deployed on that. Now I want to deploy my project on turbo server but getting following error
lenovo#siddhi:~/giftshop-api$ turbo deploy
Deploying to Turbo 360 Hosting Environment...
...............
ERROR: The runtime parameter of nodejs10.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs14.x) while creating or updating functions.
I have installed the node already with version
lenovo#siddhi:~/giftshop-api$ node -v
v16.14.2
How can I use runtime of (nodejs14.x) while creating or updating functions.?
Tried many solutions of from stack overflow but couldn't get it done.
Can anyone help please...
You can install nvm by following the instructions at https://github.com/nvm-sh/nvm
Finally, everything is just
nvm install <node-version>
nvm use <node-version>
You need to run it as admin at cmd

"Import Error lxml" is shown in AWS Lambda

I am trying to run using pygal libray to show graph in AWS lambda.But this error is shown, even I have already installed lxml.deployment_package
my_source_code
import_error
It's because lxml contains binary pre-compiled libraries that it uses. When you install lxml locally on your Windows machine, you install a Windows-compatible version of it. However this is not compatible with the Lambda execution environment which is Linux based.
So you have to create a Lambda compatible deployment package. You have couple of options doing so. You can use sam build --use-container, you can build the libraries in a Docker environment and then zip those, etc. See this answer as well.

Node.js version and Google Cloud functions

I get this message when I start a local Firebase server with firebase serve:
Warning: You're using Node.js v8.9.4 but Google Cloud Functions only supports v6.11.5.
But there is no info about what to do. What do I need to do to downgrade Node.js to v6.11.5? Should I use that version just for Firebase projects and the latest released version of Node.js for other projects? In that case how to I do that?
EDIT: The warning now looks like this and I am unable to run a new nearly empty project:
Warning: You're using Node.js v8.9.4 but Google Cloud Functions only supports v6.11.5.
! functions: Failed to load functions source code. Ensure that you have the latest SDK by running npm i --save firebase-functions inside the functions directory.
! functions: Error from emulator. mod.hasOwnProperty is not a function
So I really think I have to downgrande Node.js. But I do not know how to safely do that. Hm, looking at http://nodejs.org/ I can't even find version v6.11.5?
EDIT 2: Just checked in the new project if npm update --dev fixed the problem. It did not. (Actually no packages where updated.)
That's just a warning. You can ignore it if you know what you're doing. It's telling you that your local emulation of a function (running on node 8.9.4) may not perfectly match what the function will do when it's deployed to Cloud Functions (running 6.11.5). But as long as you're not using any features of node that are not available on node 6.11.5, you won't have a problem. I use newer versions of node to test locally all the time without problems.
You can uninstall and reinstall Cloud Functions emulator and Firebase Tools using the commands provided in the GitHub Troubleshooting guide. Since you are using Firebase, follow the instruction for the ‘Firebase Tools’.
Node v8 is now available for cloud functions:
https://firebase.googleblog.com/2018/08/cloud-functions-for-firebase-config-node-8-timeout-memory-region.html
So I believe this warning can truly be ignored...
There are several tools listed in the answers to this question
For Windows I just used nvmw successfully to accomplish this same task.
You will get the nvm here
After installation of nvm.
just use this command
"nvm install 8.9.1 64bit" you can use any version here or 64bit 32bit according to your system config
after that installation use
"nvm use 8.9.1"

Google-cloud + Node, grpc error

I am creating a sample desktop application using electron framework. When i include google-cloud node library in application i got this error.
Uncaught Error:
/home/user/Desktop/projects/sample_desktop_app/node_modules/grpc/src/node/extension_binary/grpc_node.node:
undefined symbol: GENERAL_NAME_free
OS: Ubuntu
Node Version: v7.10.0
Your help would be appreciated
Grpc id a native module that also is not officially supported for electron. This is because native modules are generally hard with electron as they need special treatment or recompilation for the respective platform.
Best way is to follow this thread https://github.com/grpc/grpc/issues/6138 but you are more or less on your own with it. I would try to have your own backend and proxy grpc calls.

Resources