Error in installing/ running serialport in node.js - node.js

Have been trying to installing/ running 'serialport' on Node.js but it fails.
First I tried installing the current version 0.7.3 and it fails with the following errors
Waf: Leaving directory `/home/anand/node/node_modules/serialport/serialport_native/build'
'build' finished successfully (0.237s)
cp: cannot stat `build/Release/serialport_native.node': No such file or directory
Next I tried installing version 0.6.7. It installs correctly but when I try to run the examples I get the following error
Error: Unable to load shared library /home/anand/node/node_modules/serialport/serialport_native.node
I have checked that the library exists and has read/write/execute permissions.
I have also checked with different versions of Node including 0.6.4, 0.6.10

Related

How I i solve Build Failed on Azure Devops Pipeline when building a node application

I have been studying azure devops in the past weeek and i have been trying to deoploy my first node app on azure but i keep running on an error of build failed. and the error is
Error Cannot find module './routes/hostelRoutes' so i have checked and confirmed that the module is available because everything runs on my local machine. Below is a pic where i get the error
According to the error message:
Error Cannot find module './routes/hostelRoutes'
The ‘node_modules’ folder could have some issues.
You could try to remove the directory ‘/node_modules/’ and re-install the folder.
Please refer to the following command line script about removing and re-installing.
cd Project_folder
rm -rf node_modules
npm install
You could check this ticket How do I resolve “Cannot find module” error using Node.js? for some information

Getting error when deploying a Google Cloud Function after Node upgrade

I updated Brew then updated Node from 10.12.0 -> 13.8.0
Now, I get the following error when trying to deploy a Google Cloud Function
firebase deploy --only functions:createJWT
i functions: preparing functions directory for
uploading...
Error: Error parsing triggers: Failed to load gRPC binary module
because it was not installed for the current system Expected
directory: node-v79-darwin-x64-unknown Found:
[node-v64-darwin-x64-unknown] This problem can often be fixed by
running "npm rebuild" on the current system Original error: Cannot
find module
'/Users/.../cloud-functions/functions/node_modules/grpc/src/node/extension_binary/node-v79-darwin-x64-unknown/grpc_node.node'
Require stack:
- /Users/.../cloud-functions/functions/node_modules/grpc/src/grpc_extension.js
- /Users/.../cloud-functions/functions/node_modules/grpc/src/client_interceptors.js
- /Users/.../cloud-functions/functions/node_modules/grpc/src/client.js
- /Users/.../cloud-functions/functions/node_modules/grpc/index.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/common-grpc/src/service.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/common-grpc/src/operation.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/common-grpc/src/index.js
- /Users/.../cloud-functions/functions/node_modules/#google-cloud/logging/src/index.js
- /Users/.../cloud-functions/functions/index.js
- /usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js
Try running "npm install" in your functions directory before
deploying.
Tried npm rebuild and npm install in my functions directory and nothing works
Furthermore...could this issue be due to the fact that GCF Node runtime enviroment is Node10 and I have installed Node13 on my machine? - according to these docs:
https://cloud.google.com/functions/docs/concepts/nodejs-10-runtime
I am struggling to revert back to Node10, have tried by running brew install node#10 and get this:
Then tried running the following command as per output above to symlink it to /usr/local but still no luck
echo 'export PATH="/usr/local/opt/node#10/bin:$PATH"' >> ~/.bash_profile
Searching around about this error, indeed, this seems that the problem is related to your system waiting for a version and founding another one - as per this part of the error.
Error: Error parsing triggers: Failed to load gRPC binary module because it was not installed for the current system Expected directory: node-v79-darwin-x64-unknown Found: [node-v64-darwin-x64-unknown]
There are some options that you can give it a try, besides trying the npm rebuild. Another option might be updating the package.json - as per this case solved here - that would return your npm version to an old one.
Besides that, on this question in the Community, there are a few solutions that helped other users, that I would recommend you to take a look at it: NodeJs Error - Failed to load gRPC binary module because it was not installed for the current system Expected directory?
Let me know if the information helped you!
Trying to deploy to an unsupported Google Function execution environment won't work. According to the google docs the current supported environments are Node8 and Node10(beta), re-installing Node10 worked for me.

native module compile error on ubuntu for node-webcrypto-ossl on electron project

I am trying to use https://www.npmjs.com/package/node-webcrypto-ossl this module in an electron project.
When I try to build it gives me following error.
g++: error: /home/username/.electron-gyp/.node-gyp/4.0.0/deps/openssl/openssl/lib/libcrypto.a: No such file or directory
nodessl.target.mk:167: recipe for target 'Release/obj.target/nodessl.node' failed
This module works ok in node only project.
It appears the openssl dependency is missing, were dependencies installed?

npm install creating files at wrong directory for electron

When I install sqlite3by npm in directory of electron project,
it creates
c:\testing\Elektron\node_modules\sqlite3\lib\binding\node-v57-win32-x64
but electron aplication throw following error:
Error: Cannot find module 'c:\testing\Elektron\node_modules\sqlite3\lib\binding\electron-v1.6-win32-x64\node_sqlite3.node'
I tried to rename the directory, but it lead to
Error: A dynamic link library (DLL) initialization routine failed.
Here is the pastebing of all commands and actions I did
I don't need work arounds, I need to build aplication later into an executable file, so I appreciate your answer.
electron-rebuild
is needed for native modules.

"node-gyp build" Fatal error C1083

I'm trying to run a project on my windows 10 (x64) with nodejs.
To run the project, I was given a list of components/packages to install that included Bower, Ruby, Sass, Grunt, MySQL and Redis. Further components included installing node-gyp, node-canvas, Python 2.7 and Microsoft Build Tools
(Link: https://github.com/Automattic/node-canvas/wiki/Installation---Windows ).
After installing all the dependencies, I keep getting an error message :
c1xx : fatal error C1083: Cannot open source file: '..\src\binding.cc': No such file or directory [C:\myeffect\build\binding.vcxproj]
I've done everything I could to resolve the error, re-installed everything, added PATH to python on the System Variables, EVERYTHING.
But the error keeps coming. Please someone Help me what to do.
you can try it, i solved it.
create C:\myeffect\src\binding.cc。 bingd.cc file is empty file。

Resources