Canvas module compilation osx error - macos

I'm trying to install captcha npm module, which exploits the canvas module.
Unfortunately I have problem to install that module on OSX.
I'm getting the following error:
> canvas#1.0.4 install ....../node_modules/canvas
> node-gyp rebuild
not found: ldconfig
gyp: Call to './util/has_lib.sh jpeg' returned exit status 0. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/Cellar/node/0.10.21/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:424:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/usr/local/Cellar/node/0.10.21/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd ...../node_modules/canvas
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
Any idea? Apparently there is ldconfig missing. But no idea how to install it.
I'm using homebrew, and I have the lastest XCode, and command line tools installed.

This is my workaround:
First we need to install cairo:
brew install cairo jpeg
It takes sometime. However now it's time to update PKG_CONFIG_PATH, pointing at the cairo libraries.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig
To compile canvas we need to have node-gyp installed.
npm install node-gyp -g
If the installation still is not working because of missing jpeg lib, you need to run:
npm install canvas
in directory of the project where it's needed and then to stop installation just before the error reporting. Then you need change directory and recompile manually the C++ binding
cd node_modules/canvas/
node-gyp rebuild
after that you should have working canvas module.

M1 native does not release binary version of canvas in node15. Therefore, when you install canvas, you will automatically compile from the source code, but if you do not install the corresponding dependency, you will report an error.
Solution
arch -arm64 brew install pkg-config cairo pango jpeg giflib librsvg

According to my knowledge you need to install Get Xcode 6.1 .
Install Xcode and the Xcode Command Line Tools
Agree to Xcode license in Terminal: sudo xcodebuild -license
Install MacPorts for your version of OS X:
OS X 10.10 Yosemite
https://www.macports.org/install.php

Related

How to solve gyp ERR! stack Error: `make` failed with exit code: 2?

I cloned a repo made by someone else to develop theia extension.
I ran the yarn command for the build, but the following error occurs.
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit ( [my directory]/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack at ChildProcess.emit (node:events:527:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 3.10.0-1160.80.1.el7.x86_64
gyp ERR! command "/afs/[security]/app/vbuild/RHEL7-x86_64/nodejs/16.15.0/bin/node" "[my directory]/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd [my directory]/node_modules/#theia/node-pty
gyp ERR! node -v v16.15.0
As I searched on Google, I deleted node_modules, package-lock.json, yarn.lock, and downgraded node version to 14, but the same error occurs.
When I do npm install I get the following error:
npm ERR! code 1
npm ERR! path [my directory]/electron
npm ERR! command failed
npm ERR! command sh -c theia build --mode development
npm ERR! Updated dependencies, please run "install" again
Did anyone else encounter this issue, or knows how to fix it?
Here are the details of the environment I'm using:
OS : Red Hat Enterprise Linux Server release 7.9 (Maipo)
node version : v16.15.0
npm version : 8.5.5
yarn version : 1.7.0
theia version : 1.x
As the error shows npm and yarn arnet able to install the theia npm package.
Check that you are using the correct theia version and its supported by your node and operating system.
im not sure what you are running on windows or linux its worth checking this out https://github.com/eclipse-theia/theia/issues/188

unable to install firebase tools in windows

Hi I'm unable to install the firebase tools via command prompt using admin mode and I am getting the error bellow:
F:\rnd\MyChat>npm install firebase
> grpc#1.8.4 install F:\rnd\MyChat\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.4/node-v57-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc#1.8.4 and node#8.9.3 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Users\ani\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.8.4 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.8.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
you are trying to install firebase javascript library not the firebase-tools the node module for firebase tools is firebase-tools and firebase 3.16 version and along with that in the local folder npm install node-gyp
you should run
npm install -g firebase-tools
This is something that may work, try doing the following.
npm i -g firebase-tools
Finally my issue has been resolved by following these below steps
firstly i installed npm install node-gyp in my local folder and downgraded my firebase-tools version from 3.17 to 3.16 and Mainly i disabled my Anti Virus
below is the reference link for that
https://github.com/grpc/grpc-node/issues/121
If you are using a newer version of nodejs try uninstalling and using node-v10.15.3
https://nodejs.org/download/release/v10.15.3/

python error on npm package install Windows

On Windows, When I try to install wdio, I have a python error :
but python is installed and in the path.
the PYTHON variable is set to "C:\Program Files\Python36\python.exe", which is a correct path.
I don't know where the error is coming from, since it says it can find the executable, bit show the right path to the executable.
PS C:\Users\admin> npm install wdio
> fibers#1.0.15 install C:\Users\admin\node_modules\fibers
> node build.js || nodejs build.js
C:\Users\admin\node_modules\fibers>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild --release ) else (node "" rebuild --release )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program Files\Python36\python.exe", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
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" "--release"
gyp ERR! cwd C:\Users\admin\node_modules\fibers
gyp ERR! node -v v8.0.0
gyp ERR! node-gyp -v v3.6.1
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\admin\package.json'
You need to install Python 2.7 since node-gyp is not compatible with Python 3.x. See e.g. https://github.com/nodejs/node-gyp#on-windows
I had to reinstall node when I had similar issue ( this just updated to the current stable) Although before that I had updated every other thing while trying a solution including python for windows and node-gyp (npm install -g node-gyp). The node js update finally did it

npm install xml2json fail to install

I am trying to work on PUSh notifications for Android/ios using node.js.
I am getting the below error when I try to install xml2json.
Please help me to fix it
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack at Object.oncomplete (fs.js:107:15)
gyp ERR! System Darwin 12.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bertils/node_modules/xml2json/node_modules/node-expat
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! node-expat#2.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat#2.0.0 install script.
npm ERR! This is most likely a problem with the node-expat 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 node-expat
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "xml2json"
npm ERR! cwd /Users/bertils
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/bertils/npm-debug.log
npm ERR! not ok code 0
Looks like the make tool is not available on your system.
To fix this, you have 2 options:
If you have Xcode already installed:
Go to Xcode > Preferences > Downloads and install the component named "Command Line Tools". All the relevant tools will be placed in /usr/bin.
Alternative:
Go to https://developer.apple.com/downloads, sign in with your developer Apple ID and search for "Command Line Tools", then download and install the appropriate file.
I was also facing the same issue on linux rhel 7, see if it works for you too, what I found out was that I needed to install gcc libraries on my instance, so I went ahead and removed my node_modules folder and then ran the sudo yum group install "Development Tools", in your case you might want to find the brew equivalent sudo yum group install "Development Tools" or xcode-select --install, and I then ran the npm install again and it worked!
Hope this helps, for issues related to installing gcc libraries and Development tools, one can refer to this url also: Install gcc and dev tools or Mac OS install dev tools

Errors aplenty installing Topojson -- contextify? node-gyp rebuild? Other threads not working Lion 10.7.5

UPDATE: SOLVED like this:
1.Like #salem said, I had to install contextify:
npm install contextify
then sudo npm install -g topojson threw an error about needing to accept an Xcode license agreement. It threw the command I needed too, so I ran that, then tried sudo npm install -g topojson again, and it worked!
Problem:
So, I'm getting errors aplenty with:
sudo npm install -g topojson
I haven't found solution in other threads.
Is Xcode right? I have Xcode 4.6.2 -- and update gives this error: "Xcode [5] can’t be installed on “Macintosh HD” because Mac OS X version 10.8.4 or later is required."
node & npm seem ok … they both spit out some help at node --help and npm --help
2a. I've tried deleting then reinstalling node using node-v0.10.24-darwin-x86.tar. Though I'm very unclear on what any of this is.
This is the end of the log:
npm ERR! Failed at the contextify#0.1.6 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 Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "topojson"
npm ERR! cwd /Users/maggielee/Downloads
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/maggielee/Downloads/npm-debug.log
npm ERR! not ok code 0
The whole log is here: http://greencracker.net/wp-content/uploads/2013/12/error.txt
What do you think?

Resources