Closed luisrudge closed 8 years ago
@mousetraps , Just tried to fresh VM Windows 8.1 pro x64 installation. Node.js v 0.12.7, python 2.7.9, npm 3.2.0, VC compiler for python 2.7 only Got this error:
MSBUILD : error MSB4132: The tools version "2.0" is unrecognized. Available tools versions are "4.0".
Same after SDK 8.1 full installation.
@Sogl In my earlier comment, I was recommending a Linux VM. Just to clarify :) Good luck!
@b-long , I already use Linux VM... but I'm curious to get node-gyp
work on Windows =)) I solved this problem on Windows 7, but 8 isn't giving up.
@Sogl Ah, I see. Sorry about that.
Just did it on fresh Windows 8.1 without installing any VS!!! :star:
Installed:
Finally go to Start -> All Programs -> Microsoft Windows SDK v7.1 -> Windows SDK 7.1 Command Prompt No need to set PATH, msvs_version and other "magic" things...
Packages browser-sync
and socket.io
installed successfully. Snapshot created.
Now I want to find a minimum set of libraries which make it works.
Great...
On Wed, Aug 12, 2015 at 9:38 AM, Artyom Mezin notifications@github.com wrote:
Just did it on fresh Windows 8.1 without installing any VS!!! [image: :star:]
Installed:
- Node.js v 0.12.7
- npm 3.2.0
- Python 2.7.9
- VC++ compiler for python 2.7
- MS build tools 2013
- SDK for Windows 8.1
- SDK for Windows 7 with SP1
Finally go to Start -> All Programs -> Microsoft Windows SDK v7.1 -> Windows SDK 7.1 Command Prompt
Packages browser-sync and socket.io installed successfully. Snapshot created.
Now I want to find a minimum set of libraries.
— Reply to this email directly or view it on GitHub https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-130324582 .
You need only these things to fix problem with node-gyp
on Windows 8.1:
Install tools with Windows SDK 7.1 Command Prompt.
All VM programs:
p.s. I tried this on Windows 10, but I can't install SDK 7.1 compiler because: And all .net 4/4.5 etc installators say that I already have .net newer version installed =(
Also if I use C++ compiler for python command prompt:
vcbuild.exe : error VCBLD0010: Project 'C:\nodejs\node_modules\browser-sync\nod
e_modules\bufferutil\build\bufferutil.vcproj' requires upgrade. Use 'vcbuild /u
pgrade' or 'devenv /upgrade' to upgrade the project. [C:\nodejs\node_modules\br
owser-sync\node_modules\bufferutil\build\binding.sln]
and with --msvs_version=2008
:
c:\users\)\.node-gyp\0.12.7\deps\v8\include\v8stdint.h(10): fatal error C1083: Cannot open
include file: 'stddef.h': No such file or directory [C:\nodejs\node_modules\browser-sync\
node_modules\bufferutil\build\binding.sln]
Those who are struggling with making it work with VS 2015 don't forget to make sure you've installed the C++ part of VS 2015. It's not installed by default.
I had installed that as part of the VS2015 and had issues ... so make sure you have the other items installed....
On Thu, Aug 13, 2015 at 7:48 AM, thorn0 notifications@github.com wrote:
Those who are struggling with making it work with VS 2015 don't forget to make sure you've installed the C++ part of VS 2015. [image: image] https://cloud.githubusercontent.com/assets/94334/9250024/a3ca627a-41d2-11e5-8efb-1417d686eaa4.png
— Reply to this email directly or view it on GitHub https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-130657536 .
@donaldhook Do you get the errors only when installing odbc
? What about other packages (e.g. socket.io
)?
Had errors there too ....
On Thu, Aug 13, 2015 at 8:32 AM, thorn0 notifications@github.com wrote:
@donaldhook https://github.com/donaldhook Do you get the errors only when installing odbc? What about other packages (e.g. socket.io)?
— Reply to this email directly or view it on GitHub https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-130672896 .
What did these errors say?
My mistake. I tried installing when I was having the ODBC issue. The errors I receive are WARNINGS... So sorry for confusing anyone or making more work.
I had posted on the ODBC board to work through the issues. I have found a work around for the time being using the JDBC npm package.
Thanks to all of you working on the issue!
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception(361): warning C4577: 'noexcept' used with no exception handling mode specified; termi nation on exception is not guaranteed. Specify /EHsc [C:\Users\dhook\AppData\Ro aming\npm\node_modules\socket.io \node_modules\socket.io-client\node_modules\eng ine.io-client\node_modules\ws\node_modules\utf-8-validate\build\validation.vcxp roj]
On Thu, Aug 13, 2015 at 8:38 AM, thorn0 notifications@github.com wrote:
What did these errors say?
— Reply to this email directly or view it on GitHub https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-130675383 .
@mousetraps, Can you help me with this? I found a workaround without VS or VC++ compiler for Python, but it not works on clean Windows 10 and often not work on not clean WIndows 8.1 because I can't install SDK 7.1.
See my previous message: https://github.com/TooTallNate/node-gyp/issues/629#issuecomment-130513913
Important info!!11 If your Windows profile folder name has non-english chars (my had russian) - change it! Like this Because there is path "C:\Users___\AppData\Roaming\npm" in %PATH%, where v8.h and other headers located.
@ukrbublik , You right! Just tried with russian username in Windows 8 and got the same v8.h
error, but with eng. username compilation done well.
Now my node-gyp
works as expected.
What I did:
npm config set msvs_version 2013
in consoleI think the problem is related with this: https://github.com/TooTallNate/node-gyp/issues/297
Doens't work for me. Install VC2015 (Windows 10 x64 bits) and when I try to install bcrypt, it still gets me the node-gyp errors:
C:\Users\mesos_000\Desktop\elixir Projects\testingBlog>npm install -g bcrypt
|
> bcrypt@0.8.5 install C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcrypt
> node-gyp rebuild
C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcrypt>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 ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
blowfish.cc
bcrypt.cc
bcrypt_node.cc
..\src\bcrypt.cc(232): warning C4267: '=' : conversion from 'size_t' to 'unsigned char', possible loss of data [C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcryp
t\build\bcrypt_lib.vcxproj]
c:\users\mesos_000\.node-gyp\0.12.7\deps\uv\include\uv-win.h(32): fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory (..\src\bcrypt_nod
e.cc) [C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` 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:269:23)
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\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcrypt
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bcrypt"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! bcrypt@0.8.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.8.5 install script 'node-gyp rebuild'.
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! Please include the following file with any support request:
npm ERR! C:\Users\mesos_000\Desktop\elixir Projects\testingBlog\npm-debug.log
@mesosteros Do you actually have winsock2.h
anywhere in Program files
or Program files (x86)
?
@thorn0 no. Don't even know what that is. I'm gonna install the Windows 7 SDK (I think it'll work on 10)
It's a part of the Windows SDK. Just to confirm, did you perform a recursive search for this file in those folders?
@thorn0 no. But the sdk isn't installing. I'm trying MicrosoftFixit to correct the installation. In the meantime I'm performing the search for winsock2.h
@thorn0 Ok it seems I have winsock2.h
on my Program Files (x86)
at the Windows Kit and Windows Phone Kits
folders
So you have the SDK.
Seems so...
I had issues installing the SDK as well, it wouldnt allow me to install it.
On Tue, Aug 18, 2015 at 10:30 AM, Carlos Santos notifications@github.com wrote:
@thorn0 https://github.com/thorn0 no. But the sdk isn't installing. I'm trying MicrosoftFixit to correct the installation. In the meantime I'm performing the search for winsock2.h
— Reply to this email directly or view it on GitHub https://github.com/nodejs/node-gyp/issues/629#issuecomment-132251191.
It might be that node-gyp requires just the Windows 7 SDK. It's installed if you tick off Windows XP Support for C++ in the VS setup. Did you tick it off?
@thorn0 I ticked what you said here but on. https://github.com/nodejs/node-gyp/issues/629#issuecomment-130657536
@mesosteros, I spent about month with C1083 error to resolve it. It was profile name bug =(
What npm version and Windows version you have?
Did you try to rename your profile folder from mesos_000
to mesos
? You can just create another profile in Windows.
Also try to clear .node-gyp
folder before build.
Did you try to build from SDK 7.1 command prompt? All prompts must be Run as Administrator
.
Try to build with --msvs_version=2015
.
@Sogl My npm version is 2.11.3 and I'm using Windows 10 Home x64 bit. My prompts are being run as administrator and I've also tried the Developer Command Prompt. I'll try changing profile name.
My npm version is 2.11.3
I recommend 3.x. Some Windows long path bugs has been fixed and more.
Couldn't manage to change my user folder since I have the Home version. Anyway it shouldn't matter since it's running from Program Files and not users. I managed to update npm and still I get the same errors. I find this issue absolutely ridiculous: I'm just trying to add a package (addict) to an Elixir/Phoenix Framework project, but that package has a dependency on another package (comeonin) which in turn points to a dependency compilation error in bcrypt wich in turn points to its dependency on node-gyp giving this error.
Couldn't manage to change my user folder since I have the Home version.
In Home you can't put your computer into Domain, can't use group policy management and some other small things... I can't see problem with profile.
Six steps that I did:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
C:\Users\old
profile to C:\Users\new
. Some more info here: (edited by @addaleax: Removed link here too, for the same reason)
Anyway it shouldn't matter since it's running from Program Files and not users.
Nope. Npm uses appdata
folder because it's a global module but running from program files. Also you can see that from your console output:
C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcrypt>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 ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
blowfish.cc
bcrypt.cc
bcrypt_node.cc
..\src\bcrypt.cc(232): warning C4267: '=' : conversion from 'size_t' to 'unsigned char', possible loss of data [C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcryp
t\build\bcrypt_lib.vcxproj]
c:\users\mesos_000\.node-gyp\0.12.7\deps\uv\include\uv-win.h(32): fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory (..\src\bcrypt_nod
e.cc) [C:\Users\mesos_000\AppData\Roaming\npm\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
Steps to update npm on Windows:
npm i -g npm@3.2.0
(global update)cd "C:\Program Files\nodejs"
and npm i npm@3.2.0
npm -v
(must be 3.2.0)More info: https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows
Managed to do what I wanted with a symlink created.
@mesosteros, Can you describe what you have done?
@Sogl I did it like so:
Run Command Prompt (as administrator):
cd C:\Users
mklink /d mesos mesos_000
Then run the Developer Command Prompt installed with Visual Studio 2015 (from the start menu -> applications), also as administrator, going to
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\
and running the command vcvarsall.bat amd64
Finally, I created a completely new phoenix project in my elixir projects folder, added
{:addict, ">= 0.1.0"}
Then the part where I was getting the error:
mix deps.get
mix deps.compile comeonin
and pronto.
Windows 7, Visual Studio 2013 Professional, python 2.7.3, tried doing
npm install kafka-node
Both it failed gloriously, all coming down to this one
npm install snappy
Went through a ton of instructions on how to set things up, got the Windows SDK 7.1, the Microsoft Build Tools 2013 and thing seem to progress well, then I finally get this error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(507,5): error MSB8008: Specified platform toolset (v120) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected. [D:\sample\node_modules\snappy\build\deps\snappy\snappy.vcxproj]
For the life of me I can't get past this, check a couple things on the internet, and still can't find a way to get around it, even though node-gyp and pangyp say they support VS2013 on Windows 7
I ended up finding this page: https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/
Went through the additional steps, setting msvs_version to 2010 and installing VS2010 + SP1
Voila, everything installs.
I need to make instructions for the rest of my development team to set this up, and having them install Windows SDK (seems unavoidable), VS2010 (seems avoidable) and setting up an msvs_version seems like a whole heck of a lot more per-user setup than should be neccesary
my current setup is this:
setx GYP_MSVS_VERSION 2015
(i'm using visual studio 2015)after that, everything runs just fine.
@mesosteros, Good! I'll try it today on my VM.
@dekarguy, v120 = vs 2012
Did you try to specify vs 2013 version with --msvs_version=2013
? I didn't install vs 2010 in my last configuration.
@Sogl Definitely tried with --msvs_version=2013
, v120 is actually 2013, really confusing and annoying
@luisrudge setx GYP_MSVS_VERSION 2013
didn't help
it's GYP_MSVS_VERSION
fixed my typo and no dice
:( Did you install the visual c++ thing?
On my Windows 7 x64, node-gyp works fine with VS2015 without setting GYP_MSVS_VERSION
. If we summarize what's been written in this issue about VS2015, we'll get only two important points to check:
_
) etc.@luisrudge Are you sure GYP_MSVS_VERSION
is really required? Doesn't it work for you without it? What's your OS?
win 8.1 x64 installed Python compiler installed npm 3.2 installed Visual Studio Express 2105 installed Windows 7 SDK added user with latin-only name
it compiles! Run cmd NOT as admin (user with latin-only name in dir path) cmd: SET VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140 - some problems with my PATH set GYP_MSVS_VERSION 2015 npm install
and it's done! (problem was with compiling bcrypt) Thanks a lot for all advises! Hope my info will be useful
@ProtomotoReal Thank you!!!
I was able to run a normal cmd window (not the Windows SDK 7.1 prompt)
SET VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120
I didn't need to set the GYP_MSVS_VERSION
, nor the npm config msvs_version
variable
It looks like for my team to get set up on Windows 7 + Visual Studio 2013 that the steps will be
Install Python 2.7
npm set python C:\Python27\python.exe --global
Install Windows 7 SDK
SET VCTargetsPath=C:\Program Files (x86)\MSBUILD\Microsoft.Cpp\v4.0\V120 npm install
Thank you all for the help, I think we can all agree that making this easier would be grand
Hi, i had the same problems with npm-gyp. Initially i got a build problem and i solved it following the suggestions in this thread. I have:
Windows 7 x64 Ultimate VS 2012 VS 2013 VS 2015 Python 2.7.6 NPM 2.13.3 NODE 0.12.7 Microsoft Windows SDK 7.1
but during the npm install exit with only an error on parsing package.json:
R:\Progetti\Nodejs\relay>npm install
npm WARN peerDependencies The peer dependency babel-core@* included from babel-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
-
> utf-8-validate@1.1.0 install R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engi
ne.io-client\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild
-
R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\no
de_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Users\Piero\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bi
n\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Compilazione dei progetti nella soluzione uno alla volta. Per abilitare la compilazione parallela, aggiungere l'opzione "/m".
validation.cc
Creating library R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-cl
ient\node_modules\ws\node_modules\utf-8-validate\build\Release\validation.lib and object R:\Progetti\Nodejs\relay\node_modules\webpa
ck-dev-server\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-validate\build\Release\
validation.exp
Generating code
Finished generating code
validation.vcxproj -> R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-
client\node_modules\ws\node_modules\utf-8-validate\build\Release\\validation.node
> bufferutil@1.1.0 install R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.i
o-client\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild
R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\no
de_modules\bufferutil>if not defined npm_config_node_gyp (node "C:\Users\Piero\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\.
.\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Compilazione dei progetti nella soluzione uno alla volta. Per abilitare la compilazione parallela, aggiungere l'opzione "/m".
bufferutil.cc
Creating library R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-cl
ient\node_modules\ws\node_modules\bufferutil\build\Release\bufferutil.lib and object R:\Progetti\Nodejs\relay\node_modules\webpack-d
ev-server\node_modules\socket.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil\build\Release\bufferut
il.exp
Generating code
Finished generating code
bufferutil.vcxproj -> R:\Progetti\Nodejs\relay\node_modules\webpack-dev-server\node_modules\socket.io-client\node_modules\engine.io-
client\node_modules\ws\node_modules\bufferutil\build\Release\\bufferutil.node
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "node" "C:\\Users\\Piero\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.7
npm ERR! npm v2.13.3
npm ERR! file C:\Users\Piero\AppData\Roaming\npm-cache\qs\4.0.0\package\package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token '\u0000' at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: C:\Users\Piero\AppData\Roaming\npm-cache\qs\4.0.0\package\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! R:\Progetti\Nodejs\relay\npm-debug.log
it seems the soccket.io-client gives problems. I set the msvs_version to 2013.
@pierol, Your node-gyp
works fine.
I think this can help: http://stackoverflow.com/questions/17944345/npm-install-cannot-read-package-json
@dekarguy, You can also check my configuration that not need VS: https://github.com/nodejs/node-gyp/issues/629#issuecomment-130513913
Now I'm fighting with VCTargetsPath
that can add normal cmd working.
@Sogl i solved thank you the reason was corrupted packages.json files on disk.
ProtomotoReal, many thanx! Finally got it going after a whole weekend of wanting to throw my laptop out the window!
This helped fixing my issues: https://github.com/nodejs/node-gyp/issues/629#issuecomment-132991527
It all started with this conversation.
As I said, I'm pretty much a newbie and I don't even know what node-gyp does, but what I DO know is that it's a pain to run Windows and install a project with node-gyp as a dependency. Some numbers:
It's bizarre that a nodejs developer needs to install visual studio (even the express edition) in order to be able to work on Windows. Even more bizarre is that I, as a .NET developer with full visual studio installed in my machine still can't download a bunch of projects that use this project.
With that being said, I'd like to know from all of you what should we do to make windows users fall in the pit of success? What are the alternatives? Does Microsoft can solve this in any way?
This issue is fixed (kinda)
@mousetraps pointed that Microsoft is shipping the C++ build tools separately now. Check here
Some updates on this gigantic thread
Absolutely non-official statement that @Microsoft is aware of this issue and seeing what can be done
@mousetraps said that this thread "is high on people's radar" at @Microsoft
Very good Q&A about noge-gyp issues on Windows and why they happen
@dekarguy took the time to answer some questions about what we all are going through