Compiling Error with sha3 & Ethereum Mist - compilation

Unhandled rejection Error: Error: npm exited with code 1
Output:
> sha3#1.2.0 install /home/user/mist/dist_mist/app/node_modules/sha3
> node-gyp rebuild
make: Entering directory '/home/user/mist/dist_mist/app/node_modules/sha3/build'
CXX(target) Release/obj.target/sha3/src/addon.o
sha3.target.mk:96: recipe for target 'Release/obj.target/sha3/src/addon.o' failed
make: Leaving directory '/home/user/mist/dist_mist/app/node_modules/sha3/build'
Error output:
In file included from /usr/include/stdint.h:25:0,
from /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h:9,
from /home/user/.electron-gyp/.node-gyp/iojs-1.4.15/deps/v8/include/v8.h:19,
from /home/user/.electron-gyp/.node-gyp/iojs-1.4.15/src/node.h:42,
from ../src/addon.cpp:1:
/usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory
compilation terminated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.10.0-28-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/mist/dist_mist/app/node_modules/sha3
gyp ERR! node -v v8.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sha3#1.2.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sha3#1.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
On Ubuntu 16.04:
I am getting this error after running gulp --linux in ~/mist.
I've tried researching for sha3 errors, I find similar posts, but cannot find a solution.
What do I do to fix? Thanks.

Faced the same problem when trying to install a truffle box. There is an issue with installing the sha3 dependency.
Somehow using a specific version of nvm solves the problem.
$ nvm install 10.16.0
$ nvm alias default 10.16.0

type in : npm install sha3 and then sudo yarn
that will work for

Related

Trying to install an app with node-sass on WSL. Getting "gyp ERR! stack Error: `make` failed with exit code: 2"

I was trying to install some magento storefront app that requires linux to run on WSL. I managed to get most things working, but in the end I'm stuck at trying to install the dependencies. When it tries to install node-sass, I get this error:
make: Leaving directory '/mnt/c/Github/psp-storefront-magento2/node_modules/node-sass/build'
make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/mnt/c/Github/psp-storefront-magento2/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (node:events:390:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Linux 4.4.0-19041-Microsoft
gyp ERR! command "/home/lursmani/.nvm/versions/node/v16.10.0/bin/node" "/mnt/c/Github/psp-storefront-magento2/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /mnt/c/Github/psp-storefront-magento2/node_modules/node-sass
gyp ERR! node -v v16.10.0
I read that deleting yarn.lock and installing again should fix this, but it hasn't helped in my case. Would greatly appreciate some help with this, if anyone knows what's funky here.
I found the solution. Apparently GYP has issues with the latest version of Node (16). I had to downgrade to Node 14 and then it worked correctly.

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.

Install canvas fails using npm

I'm using macOS Mojave, Xcode 10.1. I'm struggling when running npm install canvas. node-gyp is 3.8.0 of mine.
npm WARN package.json babylon#5.5.29 No repository field.
npm WARN package.json babylon#5.5.29 No README data
npm WARN package.json babylon#5.5.29 No license field.
-
> canvas#1.3.12 install /Users/chuoi/project/node_modules/canvas
> node-gyp rebuild
SOLINK_MODULE(target) Release/canvas-postbuild.node
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/canvas-postbuild.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/chuoi/.nvm/versions/node/v4.3.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270: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 Darwin 18.2.0
gyp ERR! command "/Users/chuoi/.nvm/versions/node/v4.3.1/bin/node" "/Users/chuoi/.nvm/versions/node/v4.3.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/chuoi/project/node_modules/canvas
gyp ERR! node -v v4.3.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Darwin 18.2.0
npm ERR! argv "/Users/chuoi/.nvm/versions/node/v4.3.1/bin/node" "/Users/chuoi/.nvm/versions/node/v4.3.1/bin/npm" "install" "canvas"
npm ERR! node v4.3.1
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! canvas#1.3.12 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas#1.3.12 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the canvas 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 canvas
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/chuoi/project/middleware/npm-debug.log
Could you help me on this cause it takes a whole day and I have no idea how to fix it.
You need to update your node version. Canvas doesn't support node 4.x.
"The minimum version of Node.js required is 6.0.0."
https://www.npmjs.com/package/canvas

configure: error: C compiler cannot create executables mac

I am trying to install ccxt on my Macbook Air using sudo npm install --save ccxt and encountered the following error:
> scrypt#6.0.3 preinstall /Applications/Xcode.app/Contents/Developer/Toolchains/node_modules/scrypt
> node node-scrypt-preinstall.js
Error: Error: Command failed: ./configure
configure: error: in `/Applications/Xcode.app/Contents/Developer/Toolchains/node_modules/scrypt/scrypt/scrypt-1.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
> scrypt#6.0.3 install /Applications/Xcode.app/Contents/Developer/Toolchains/node_modules/scrypt
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/peterpham/anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:275:12)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:346:11)
gyp ERR! stack at emitOne (events.js:116:13)
gyp ERR! stack at Socket.emit (events.js:211:7)
gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:557:12)
gyp ERR! System Darwin 17.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 /Applications/Xcode.app/Contents/Developer/Toolchains/node_modules/scrypt
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/Applications/Xcode.app/Contents/Developer/Toolchains/package.json'
npm WARN Toolchains No description
npm WARN Toolchains No repository field.
npm WARN Toolchains No README data
npm WARN Toolchains No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt#6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 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/peterpham/.npm/_logs/2018-08-30T04_34_20_141Z-debug.log
I have Xcode 9.4.1 installed and checked that my command line tools were installed in the Preferences > Location section like in this other stackoverflow question. I also tried out all of the following answers in my terminal to change directories and ownerships to no avail. Also tried just sudo npm install --save scrypt with the same error. It has possibly something to do with the anaconda env pathing.
I'm pretty sure it has to do with some configuration but I'm not sure what it is. If you need anymore information please tell me and I'll post it. I don't know where the configure.log is so I can't post it, I've tried to find it using resources online as well and am lost.
The key to solving the error was this part of the error code:
gyp ERR! stack Error: Command failed: /Users/peterpham/anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
So I tried installing python 2.7, which didn't work. So I tried uninstalling Anaconda from my computer using App Cleaner and that did the trick. Afterwards I could run the command npm install --save ccxt!

Unable to npm i x509 on osx

So I don't seem to be able to install the x509 package on Mac osx.
my-air:temp me$ node -v
v10.0.0
my-air:temp me$ npm -v
6.3.0
my-air:temp me$ npm i x509
> x509#0.3.3 install /Users/me/workspace/temp/node_modules/x509
> node-gyp rebuild
CXX(target) Release/obj.target/x509/src/addon.o
In file included from ../src/addon.cc:5:
In file included from ../include/x509.h:7:
In file included from ../../nan/nan.h:194:
../../nan/nan_maybe_43_inl.h:88:15: error: no member named 'ForceSet' in 'v8::Object'
return obj->ForceSet(GetCurrentContext(), key, value, attribs);
...
4 warnings and 7 errors generated.
make: *** [Release/obj.target/x509/src/addon.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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:225:12)
gyp ERR! System Darwin 17.6.0
gyp ERR! command "/usr/local/Cellar/node/7.0.0/bin/node"
"/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
"rebuild"
gyp ERR! cwd /Users/me/workspace/temp/node_modules/x509
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! x509#0.3.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the x509#0.3.3 install script.
Any help would be greatly appreciated. Am I missing a c compiler or something?

Resources