Error installing node-weak on Windows7 - node.js

I can't seem to load node-weak on Windows7. I've tried Python 2.7, 2.5, 2.3, to no avail. It seems (from the error below), that I need to use a version of Python2, but changing versions doesn't seem to help. Any help is appreciated.
C:\project1\node_modules\weak>node "C:\Program Files (x86)\nodejs\node_modules\npm\
bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! rebuild error Error: Python executable "c:\Python25\python.exe" is Pyth
on 3, which is not supported.
gyp ERR! rebuild error at failPython3 (C:\Program Files (x86)\nodejs\node_mo
dules\npm\node_modules\node-gyp\lib\configure.js:90:14)
gyp ERR! rebuild error at C:\Program Files (x86)\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:79:9
gyp ERR! rebuild error at ChildProcess.exithandler (child_process.js:534:7)
gyp ERR! rebuild error at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! rebuild error at maybeClose (child_process.js:634:16)
gyp ERR! rebuild error at Process._handle.onexit (child_process.js:676:5)
gyp ERR! not ok
npm ERR! weak#0.2.1 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the weak#0.2.1 install script.
npm ERR! This is most likely a problem with the weak 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 weak
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "weak"
npm ERR! cwd C:\project1
npm ERR! node -v v0.8.1
npm ERR! npm -v 1.1.33
npm ERR! code ELIFECYCLE
npm ERR! message weak#0.2.1 install: `node-gyp rebuild`
npm ERR! message `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\project1\npm-debug.log
npm ERR! not ok code 0

Apparently node-gyp#0.5.2 had a bug where it wouldn't parse the Python version number properly, but that was fixed in 036a730f4a3a95e65d8f390f7f5c4f0d3321e422 (0.5.3). To fix the issue, I had to update node-gyp:
cd "C:\Program Files (x86)\nodejs"
npm install node-gyp
Simple solution, but a difficult problem to track down.

I had a similar issue on Virtual box on Linux Mint in Windows 7 host. The nodejs(v0.6.19) and npm(v1.1.14) libs I procured through apt-get were outdated. I installed both npm(v1.3.11) and nodejs(v0.10.20) through source code from here.
I encountered errors when compiling the code in shared folder as symbolic links creation is disabled in shared folders. So, I extracted zips, compiled and installed these files outside the shared folders. This resolved the issue straightaway.

Related

"node-gyp rebuild" error in mac

I wanted to follow this page to run JSBin locally.
I just installed xcode 8.2 in my mac. Now, npm -v returns 3.10.9; node -v returns v7.2.1. However, npm install raised errors:
/Users/softtimur/Startup/WebProjects/jsbin$ npm install
> hashring#3.0.0 install /Users/softtimur/Startup/WebProjects/jsbin/node_modules/hashring
> node-gyp rebuild
CXX(target) Release/obj.target/hashvalue/src/hashvalue.o
In file included from ../src/hashvalue.cc:1:
../../nan/nan.h:189:68: error: too many arguments to function call, expected at most 2, have 4
return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
...
...
...
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
13 warnings and 20 errors generated.
make: *** [Release/obj.target/hashvalue/src/hashvalue.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:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.1.0
gyp ERR! command "/usr/local/Cellar/node/7.2.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/softtimur/Startup/WebProjects/jsbin/node_modules/hashring
gyp ERR! node -v v7.2.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN mocha-casperjs#0.5.8 requires a peer of casperjs#>= 1.1.0-beta3 but none was installed.
npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/Cellar/node/7.2.1/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v7.2.1
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! hashring#3.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hashring#3.0.0 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hashring 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 information on how to open an issue for this project with:
npm ERR! npm bugs hashring
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls hashring
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/softtimur/Startup/WebProjects/jsbin/npm-debug.log
Does anyone know what's wrong here?
Downgrade Node to v10, like this:
brew uninstall node
brew install node#10
brew link --force --overwrite node#10
npm i should finish without errors now.
The problem is that hashring v3.0.0 depends on an older version of nan (v1.3.x), which is not compatible with recent versions of node. It should be noted that as of this writing, the current version of hashring (v3.2.0) no longer contains an addon, it's javascript only.
The hashring dependency comes from jsbin's memcached dependency, which is currently hard coded to a specific git commit hash. There was a PR to update this dependency a number of months ago but was apparently dismissed because the maintainer(s) are apparently not interested in supporting modern versions of node. You may want to create an issue on their tracker to voice your concern about node compatibility.

npm install fails with node-gyp build error

Today when I run npm install, it fails and gives me the following error log. I know it's an issue with hashtable but I have never had this issue before.
> hashtable#2.0.2 install /Users/admin/myproject/node_modules/hashtable
> node-gyp configure build
CXX(target) Release/obj.target/native/src/hashtable.o
SOLINK_MODULE(target) Release/native.node
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/native.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/admin/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276: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 15.5.0
gyp ERR! command "/usr/local/bin/node" "/Users/admin/.npm-packages/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /Users/admin/myproject/node_modules/hashtable
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
myproject#0.0.1 /Users/admin/myproject
└── (empty)
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/Users/admin/.npm-packages/bin/npm" "install"
npm ERR! node v4.4.7
npm ERR! npm v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! hashtable#2.0.2 install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hashtable#2.0.2 install script 'node-gyp configure build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hashtable 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 information on how to open an issue for this project with:
npm ERR! npm bugs hashtable
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls hashtable
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/admin/myproject/npm-debug.log
npm ERR! code 1
I thought there might be a problem with node-gyp so I did a npm install node-gyp -g separately but the issue did not go away. Does anyone know how to resolve this?
By the way, I am on Mac,running OSX 10.11.5, also recently installed XCode 6.3.2 for a separate project and can only use this version of XCode, not sure if that is causing the problem.
node-gyp also requires python and xcode on MacOs for C++ compilation. There are similar requirements for other systems.
You can find the pre-reqs for the node-gyp package on its npm page here.

NPM cannot install "truffle" on Windows

I am trying to install "truffle" with npm, but I am not familiar with NodeJS and cant figure out why npm wont install it. I try npm install -g truffle in Powershell with Admin rights and after a few lines of output I get this block of error messages:
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (F:\nodeJS\node_modules\npm\node_modules\node-gyp\lib\build.js:276: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 Windows_NT 10.0.14393
gyp ERR! command "F:\\nodeJS\\node.exe" "F:\\nodeJS\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Max\AppData\Roaming\npm\node_modules\truffle\node_modules\ether-pudding\node_modules\ethereumjs-testrpc\node_modules\ethereumjs-wallet\node_modules\scrypt.js\node_modules\scrypt
gyp ERR! node -v v4.5.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok\
And then after many many yellow lines I finally get this:
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "F:\\nodeJS\\node.exe" "F:\\nodeJS\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "truffle"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE
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 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the scrypt 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 information on how to open an issue for this project with:
npm ERR! npm bugs scrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls scrypt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! F:\eth_truffle\npm-debug.log
After that nothing else happens and after a while it just terminates. There are no files (other than a single log file) in the directory I am currently in and the keyword "truffle" can also not be found by cmd/powershell.
As I said I have never worked with NodeJS before and have no idea what all this means. What I can do to get truffle running?
Your install is failing at node-gyp rebuild. Solutions to this problem are listed on the node-gyp repo. The quickest is:
"Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator)." This will install Python and Visual Studio correctly.
Also, you are using Node 4.5. The recommended version is 5+, according to the Truffle Docs
I was also facing the same problem...
Solution:
Run as administrator
npm install --global windows-build-tools
npm install -g truffle

Unable to install contextify on Windows

Here's what it returns when I try install contextify:
npm install contextify
npm WARN install Couldn't install optional dependency: Unsupported
npm WARN install Couldn't install optional dependency: Unsupported
> contextify#0.1.14 install F:\_vms\HomesteadCode\_live\misc\web-react\node_modules\contextify
> node-gyp rebuild
F:\_vms\HomesteadCode\_live\misc\web-react\node_modules\contextify>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
gyp: F:\Program Files (x86)\nodejs\common.gypi not found (cwd: F:\_vms\HomesteadCode\_live\misc\web-react\node_modules\contextify) while reading includes of binding.gyp 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 (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:357:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd F:\_vms\HomesteadCode\_live\misc\web-react\node_modules\contextify
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "contextify"
npm ERR! node v0.12.7
npm ERR! npm v3.3.1
npm ERR! code ELIFECYCLE
npm ERR! contextify#0.1.14 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify#0.1.14 install script 'node-gyp rebuild'.
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! Please include the following file with any support request:
npm ERR! F:\_vms\HomesteadCode\_live\misc\web-react\npm-debug.log
UPDATE:
Got it installed... perhaps the hard way.
Installed Visual Studio 2013 (removed 2015)
Made sure I have latest nodejs
Cleaned up environment paths. (Checkout Rapidee)
Add a system variable: (mine: set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120)
From my global node_modules (for me F:\Program Files\nodejs\node_modules\npm\node_modules) I cloned repo git clone git#github.com:brianmcd/contextify.git. CD into then rm -rf .git.
I had to next npm i nan
node-gyp rebuild
It installed without any more complaints!!!!
I hope that someone comes up with a better solution than this!!!
This is problem with python on windows ( https://github.com/nodejs/node-gyp/issues/629 )
There is probably not much you can do about this. You can try some workarounds, that they suggest in comments, but I do not know how much it'll help you.
Look at this link:
common.gypi not found error in node.js
Seems to be a common issue these days.
You can check https://github.com/TooTallNate/node-gyp/issues/313 and
https://github.com/TooTallNate/node-gyp/issues/376 to see if any of
these solutions solve your issue.
Particularly, you can:
Remove old dir ~/.node_gyp and run npm install
Copy an older version (ex: ~/.node-gyp/0.10.11/) to the complying path.
Copy the latest version to the complying path.
Chime in this thread to get help.
PS:
When I tried installing on Windows, I get a completely different error:
d:\temp>npm install -g contextify
> contextify#0.1.14 install C:\Users\paulsm\AppData\Roaming\npm\node_module\contextify
> node-gyp rebuild
C:\Users\paulsm\AppData\Roaming\npm\node_modules\contextify>node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
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 failNoPython (D:\Program Files\nodejs\node_module\npm\node_modules\node-gyp\lib\configure.js:103:14)
<= NOTE: This is *not* your problem
When I ran sudo npm install -g contextify on a Linux box ... "everything worked".
Again - please review the links above, and see if they help.

npm install fails with gyp build error

I have been trying to get node and git working for a web project I am working on without any luck.
I have installed node from their website. When I try to do npm install on the git project I am working on it gives me the following error
C:\Users\Jibran\Desktop\ekhadim\ekhadimweb>npm install
npm http GET https://registry.npmjs.org/bcrypt
npm http 304 https://registry.npmjs.org/bcrypt
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings
> bcrypt#0.7.8 install C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\b
crypt
> node-gyp rebuild
C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\bcrypt>node "C:\Program
Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\
node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: The Platform for project 'bcrypt_lib.vcxproj' is
invalid. Platform='x64'. You may be seeing this message because you are tryin
g to build a project without a solution file, and have specified a non-default
Platform that doesn't exist for this project. [C:\Users\Jibran\Desktop\ekhadim\
ekhadimweb\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\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:807:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\bcrypt
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! bcrypt#0.7.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt#0.7.8 install script.
npm ERR! This is most likely a problem with the bcrypt 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 bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\Jibran\Desktop\ekhadim\ekhadimweb
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\npm-debug.log
npm ERR! not ok code 0
I have installed python, VC++ 2008 and 2010 and OpenSSL but nothing has worked for me yet.
Any help will be appreciated.
Thanks
Jibran
Installing windows build tools worked for me:
npm install --global --production windows-build-tools
Follow : https://github.com/nodejs/node-gyp#installation
Installing windows-build-tools didn't work for me. What did the trick was directly downloading and installing Python.

Resources