I am not able to install Hyperledger Composer on Mac OS X - hyperledger-composer

I have OSX 10.12.6 with all dependency
When I am tryng to install composer-cli it throws following error
npm install -g composer-cli
npm WARN deprecated fs-promise#1.0.0: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated crypto#0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
npm WARN deprecated jade#1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated transformers#2.1.0: Deprecated, use jstransformer
npm WARN deprecated nodemailer#2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
/usr/local/bin/composer -> /usr/local/lib/node_modules/composer-cli/cli.js
> fsevents#1.1.3 install /usr/local/lib/node_modules/composer-cli/node_modules/fsevents
> node install
[fsevents] Success: "/usr/local/lib/node_modules/composer-cli/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> pkcs11js#1.0.10 install /usr/local/lib/node_modules/composer-cli/node_modules/pkcs11js
> node-gyp rebuild
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
CXX(target) Release/obj.target/pkcs11/src/main.o
Using built-in specs.
COLLECT_GCC=c++
c++: error: unrecognized command line option ‘-stdlib=libc++’
c++: error: unrecognized command line option ‘-stdlib=libc++’
Target: x86_64-apple-darwin11.4.2
Configured with: ./configure --prefix=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-gxx-include-dir=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/gcc/include/c++ --bindir=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/bin --datarootdir=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/share --libdir=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib --with-gmp=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-mpfr=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-mpc=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-isl=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-cloog=/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --with-boot-ldflags='-Wl,-headerpad_max_install_names -Wl,-L/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -Wl,-L/usr/lib' --with-stage1-ldflags='-Wl,-headerpad_max_install_names -Wl,-L/Users/ray/mc-x64-3.5/conda-bld/gcc-4.8_1477649012852/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib -Wl,-L/usr/lib' --enable-checking=release --with-tune=generic --disable-multilib
Thread model: posix
gcc version 4.8.5 (GCC)
make: *** [Release/obj.target/pkcs11/src/main.o] Error 1
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:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 16.7.0
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 /usr/local/lib/node_modules/composer-cli/node_modules/pkcs11js
gyp ERR! node -v v8.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pkcs11js#1.0.10 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pkcs11js#1.0.10 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ketan/.npm/_logs/2017-11-28T10_36_54_081Z-debug.log

You seem to be compiling the native modules with gcc rather than Apple XCode. You need to install XCode to compile native modules on Mac.
On my system I see:
node-gyp rebuild
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
CXX(target) Release/obj.target/pkcs11/src/main.o
Apple LLVM version 9.0.0 (clang-900.0.38)
Target: x86_64-apple-darwin17.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.7.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 302.3.1 -v -dwarf-column-info -debug-info-kind=standalone -dwarf-version=2 -debugger-tuning=lldb -coverage-notes-file /Users/dselman/.nvm/versions/node/v8.9.1/lib/node_modules/composer-cli/node_modules/pkcs11js/build/Release/obj.target/pkcs11/src/main.gcno -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0 -dependency-file ./Release/.deps/Release/obj.target/pkcs11/src/main.o.d.raw -MT Release/obj.target/pkcs11/src/main.o -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -D NODE_GYP_MODULE_NAME=pkcs11 -D USING_UV_SHARED=1 -D USING_V8_SHARED=1 -D V8_DEPRECATION_WARNINGS=1 -D _DARWIN_USE_64_BIT_INODE=1 -D _LARGEFILE_SOURCE -D _FILE_OFFSET_BITS=64 -D BUILDING_NODE_EXTENSION -I /Users/dselman/.node-gyp/8.9.1/include/node -I /Users/dselman/.node-gyp/8.9.1/src -I /Users/dselman/.node-gyp/8.9.1/deps/uv/include -I /Users/dselman/.node-gyp/8.9.1/deps/v8/include -I ../../nan -I ../includes -I/usr/local/include -stdlib=libc++ -stdlib=libc++ -Os -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/dselman/.nvm/versions/node/v8.9.1/lib/node_modules/composer-cli/node_modules/pkcs11js/build -ferror-limit 19 -fmessage-length 238 -stack-protector 1 -fblocks -fno-rtti -fno-threadsafe-statics -fobjc-runtime=macosx-10.7.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o Release/obj.target/pkcs11/src/main.o -x c++ ../src/main.cpp
clang -cc1 version 9.0.0 (clang-900.0.38) default target x86_64-apple-darwin17.2.0

Please add the following option to run the npm install success in the previous command.
npm install -g composer-cli --unsafe-perm

If you are using MacPorts in your PATH environment of your .bash_profile file, you can disable it to avoid that issue. You can verify if the correct compiler is working typing (below is my output):
Gironda-MacBook:Gironda$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Sometimes even if we installed the Apple XCode correctly, the PATH environment cause that issue. Now you can also use npm install -g composer-cli#X.X.X. But be careful if you won't need to adapt anymore your PATH environment variable for use with MacPorts.

Related

Cannot install hyperledger composer-cli on ubuntu because of g++

On ubuntu 18.04 I get an eror when I try to install the hyperledger local development environment as supposed in
https://ibm-blockchain.github.io/develop/installing/development-tools.html.
It tells me that it doesn't know the g++ command.
My configuration listing:
npm: v6.9.0
docker: 18.x
docker-compose: 1.24
node: 10.15.3 (also tried with v11.10.0 and 8.9)
npm: 6.4.1
git: 2.17.1
Python 2.7.14
Following the error log after running "npm install -g composer-cli":
npm WARN deprecated core-js#2.3.0: core-js#<2.6.5 is no longer maintained. Please, upgrade to core-js#3 or at least to actual version of core-js#2.
/home/myuser/.nvm/versions/node/v8.15.1/bin/composer -> /home/myuser /.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/cli.js
> dtrace-provider#0.8.7 install /home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js
make: Verzeichnis „/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/dtrace-provider/build“ wird betreten
TOUCH Release/obj.target/DTraceProviderStub.stamp
make: Verzeichnis „/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/dtrace-provider/build“ wird verlassen
> node-report#2.2.1 install /home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/node-report
> node-gyp rebuild
make: Verzeichnis „/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/node-report/build“ wird betreten
CXX(target) Release/obj.target/api/src/node_report.o
make: g++: Command not found
api.target.mk:107: recipe for target 'Release/obj.target/api/src/node_report.o' failed
make: *** [Release/obj.target/api/src/node_report.o] Error 127
make: Verzeichnis „/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/node-report/build“ wird verlassen
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-47-generic
gyp ERR! command "/home/myuser/.nvm/versions/node/v8.15.1/bin/node" "/home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/myuser/.nvm/versions/node/v8.15.1/lib/node_modules/composer-cli/node_modules/node-report
gyp ERR! node -v v8.15.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/composer-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-report#2.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-report#2.2.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/myuser/.npm/_logs/2019-04-05T08_35_08_242Z-debug.log
Check your node & npm version. Below is the requirement:
Node: 8.9 or higher (note version 9 is not supported)
npm: v5.x
I have both and able to install it successfully on Ubuntu 18.

failed to install composer-cli but I see errors

I see the following errors when run command npm install -g composer-cli#0.20
nvm 0.33.0
npm 6.4.1
node 10.13.0
I'm trying to the Hyperledger in my local Mac OS
but it keep failing when I run the command.
I followed this guide to install it
https://hyperledger.github.io/composer/latest/installing/development-tools.html
here's the error part:
grpc#1.10.1 install /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-darwin-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc#1.10.1 and node#10.13.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Pre-built binaries not installable for grpc#1.10.1 and node#10.13.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
sed: ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
rm: ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/Users/jason/.nvm/versions/node/v10.13.0/bin/node" "/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/jason/.nvm/versions/node/v10.13.0/bin/node /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Darwin 17.4.0
node-pre-gyp ERR! command "/Users/jason/.nvm/versions/node/v10.13.0/bin/node" "/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
node-pre-gyp ERR! node -v v10.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok
Failed to execute '/Users/jason/.nvm/versions/node/v10.13.0/bin/node /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.oe
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o
In file included from ../deps/grpc/src/core/lib/channel/channel_stack_builder.cc:19:
In file included from ../deps/grpc/src/core/lib/channel/channel_stack_builder.h:24:
../deps/grpc/src/core/lib/channel/channel_args.h:22:10: fatal error:
'grpc/compression.h' file not found
#include <grpc/compression.h>
^~~~~~~~~~~~~~~~~~~~
1 error generated.░⸩ ⠏ install: info lifecycle grpc#1.10.1~install: Failed to e
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o] Error 1
gyp ERR! build error ⠏ install: info lifecycle grpc#1.10.1~install: Failed to e
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/Users/jason/.nvm/versions/node/v10.13.0/bin/node" "/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.10.1 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.10.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jason/.npm/_logs/2018-10-31T02_08_58_962Z-debug.log
This is because node has just released node 10 as lts and the prereqs-ubuntu.sh script installs the lts version of node so you are now getting node 10.
It's easy to fix, just before installing composer just run the following commands
nvm install 8
nvm use 8
this will install node 8 and then you are ready to install composer.
This error occurs due to incompatibility of node version. You have to downgrade your node version to 8.x.x.
Just follow the steps written below:
First search for your desired package:
brew search node
This will give you the follow results:
leafnode node node#6 nodebrew
libbitcoin-node node-build node#8 nodeenv
llnode node#10 ✔ node_exporter nodenv
....
And then install the desired version:
brew install node#8
Also remember that you can install more than 1 node package at the same time, but you cannot have them available at the same time. So if you have the latest/generic node package already installed you need to unlink it first:
brew unlink node
And then you can link a different version:
brew link node#8
Now you can install composer-cli.
Note: Run the composer-tools installation commands without sudo or
root.

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 odbc fails on OSX and Ubuntu

I'm having an issue install the odbc package on both OSX and Ubuntu.
I have unixODBC installed on both machines.
Here is the output of issuing "npm install odbc":
npm http GET https://registry.npmjs.org/odbc
npm http 304 https://registry.npmjs.org/odbc
> odbc#0.6.3 preinstall /home/notes/as400/node_modules/odbc
> node-gyp configure build
Traceback (most recent call last):
File "/usr/share/node-v0.10.26-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 18, in <module>
sys.exit(gyp.script_main())
AttributeError: 'module' object has no attribute 'script_main'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-v0.10.26-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "node" "/usr/share/node-v0.10.26-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/notes/as400/node_modules/odbc
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! odbc#0.6.3 preinstall: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the odbc#0.6.3 preinstall script.
npm ERR! This is most likely a problem with the odbc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls odbc
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/share/node/bin/node" "/usr/share/node/bin/npm" "install" "odbc"
npm ERR! cwd /home/notes/as400
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/notes/as400/npm-debug.log
npm ERR! not ok code 0
EDIT 03/05/2014
I installed unixODBC on my Mac using Macports without any issues. Now when I try "npm install odbc --save", I get the following error about sql.h missing:
npm http GET https://registry.npmjs.org/odbc
npm http 304 https://registry.npmjs.org/odbc
> odbc#0.6.3 preinstall /Users/patrick/IdeaProjects/XTL/vouchers-paid/node_modules/odbc
> node-gyp configure build
CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
In file included from ../src/odbc.cpp:25:
../src/odbc.h:29:10: fatal error: 'sql.h' file not found
#include <sql.h>
^
1 error generated.
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Error 1
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:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/patrick/IdeaProjects/XTL/vouchers-paid/node_modules/odbc
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
Here is what worked for me (OSX 10.10.2)
Installing unixODBC via MacPorts did not work. The port itself
installs and automatically updates the include paths and the compiler
finds sql.h. But then the linker fails.
Installing unixodbc via Homebrew works. The include paths are not
updated, but this can be fixed, as indicated by the other answers.
For the installation of the odbc package you can use the following shell script:
#!/usr/bin/env bash
SRC_ODBC=/usr/local/Cellar/unixodbc/2.3.2_1/include
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$SRC_ODBC
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$SRC_ODBC
npm install odbc
As stated on npmjs.org there are additional binaries that need to be installed:
> on Ubuntu/Debian sudo apt-get install unixodbc unixodbc-dev
> on OSX using macports.org sudo port unixODBC
for more info: https://www.npmjs.org/package/odbc
sudo port unixODBC
is also wrong.
sudo port install unixodbc
is right.
Port install the lib and header files in other directories /opt/local/include and /opt/local/lib. To use them you have to told npm or the environment about.
But no idea how. May someone more experienced.
Or you use homebrew:
brew install unixodbc
That will work.
After installing using
sudo port install unixodbc
$ C_INCLUDE_PATH=/Where_You_Installed/ibm/dsdriver/include
$ CPLUS_INCLUDE_PATH=/Where_You_Installed/ibm/dsdriver/include
$ export C_INCLUDE_PATH
$ export CPLUS_INCLUDE_PATH
Then run
npm install ibm_db

Canvas module compilation osx error

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

Resources