-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[solved] Using Visual C++ Build Tools 2015 – standalone C++ tools #802
Comments
Adding
Need to tell |
@dotnetCarpenter hey, thanks for trying it out! Did you end up getting it working? Is there anything missing from these steps? #629 (comment) |
thx @mousetraps. Unfortunately I'm not sure how to tell node-gyp to use MSBuild.exe. You comment prompted me to try just compiling a project via I saw that you successfully compiled Got .Net 4.5.2 : Entire output:
|
Did you install the Windows sdk too when installing the build tools (this should be the default)? I believe that's where winsock2.h comes from. |
I get a similar errors when building ws.
|
@dotnetCarpenter Even after installing the Windows sdk? |
Should I install the Windows 8.1 SDK with the Build Tools installer or the Windows 7 SDK when I'm on Windows 7? Unfortunately I can not update to Windows 10 due to an unknown installation error when upgrading. |
Hmm.. I somehow thought I could get things compiling without a Windows SDK but in the end I installed Windows 8.1 SDK via the installer and things seems to be working. 🎉 OS: Windows7 |
@dotnetCarpenter C:\Users\rickm\AppData\Roaming\npm\node_modules\selenium-webdriver\node_modules\utf-8-validate>if not defined npm_config_node_gyp (node "C:\Users\rickm\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild ) |
Looks like you're missing the Windows 10 SDK, since you are on Windows 10. I think you can uninstall Windows SDK 8.1. Let me know if it works and I'll update the guide to be more clear. Also, be sure to: |
I have installed the windows 10 SDKs but somehow I think it failed to add it to the registry (or something like that), but I don't know how to fix it... |
Run the |
@dotnetCarpenter I finally got it working checking BOTH windows 10 SDKs and windows 8 SDK (I'm on win10) when installing the 2015 build tools. It seems that somehow the windows 10 SDKs is built on top of the windows 8 SDKs OR the windows 10 SDKs package has a bug that fails to add the correspondent registry values, and my system is simple using the windows 8 SDKs (when I added it later). |
sounds weird. perhaps @mousetraps has an idea to why. |
@dotnetCarpenter - I followed your Guide above with a clean install of Windows 10. The only correction I would make is that, while the Windows 8.1 SDK must be installed, the Windows 10 SDK is completely unnecessary (at least for the purpose of this issue). |
@LittleBrainz thanks. I will update the guide. |
@mousetraps I can't find the link to Microsoft Visual C++ Build Tools 2015. It seems that you're out of Technical Preview but there is no updates on the C++ blog |
@dotnetCarpenter Link was fixed on the C++ blog: |
@HoriLiu thanks! updated |
@mousetraps I suspect that the Windows SDK prerequisite, is node add-on dependent. So if add-on A uses some feature of Windows 10 SDK, then we must install the Windows 10 SDK, correct? |
I haven't submitted the PR for this yet because I need to confirm something w/ the cpp team (and also update the link and verify Express for Desktop steps), but committed minimal required steps to this branch. It shouldn't be necessary to check the Windows SDK boxes - as explained in #629 (comment), if you select the default install, a minimal set of dependencies from both the Windows 8.1 and Windows 10 SDK will be installed (and yeah, it's confusing because neither box gets checked). We're still working out a few kinks w/ custom install, though. Any chance you could try those steps, and let us know if you run into any issues? |
What confused me about the installation steps is actually from the c++ blog images, where Windows 8.1 SDK is ticked and your initial comment was not specific about the SDKs. I honestly don't remember if I choose the default installation the first time around but I will try later and update the guide if it works. |
Well ticking the sdk box should (theoretically) work fine too... and it actually works fine on my machine and several VM configs I've tested (haven't been able to reproduce the other issues ppl are running into yet), but unfortunately we can't ship my machine - partly because it wouldn't scale, and partly because it got stolen today... 😞 In any case, that's the reason we call it "preview" 😃, so we appreciate the feedback and hopefully we can work it all into the RTM release! |
I've been trying to get my Windows 7 development environment set up for a while now and nothing I try seems to be working. Steps I took:
Results:
Anyone have any ideas? |
I'm pretty sure that you need to install Windows 8.1 SDK. I think I had the same issue as you. According to @mousetraps the installer is trying to be smart and only install the bare minimum. But it seems that no one has gotten it to work without the Windows 8.1 SDK. Note that no one here have had to install the Windows 10 SDK... |
Hi @dotnetCarpenter, thanks for the quick response. I thought that the Windows 8.1 SDK was included with the VC++ Build Tools, which is why I did not install it earlier. In any case, I installed it from here, and it finished almost instantly, which leads me to believe that I already had it installed. I attempted an |
@mrparkers Try deleting the .node-gyp directory, then run |
@bnoordhuis After doing that, I started getting a different error: I feel like I'm taking one step forward and two steps back with every attempt at solving my problem 😢 |
The stddef.h error means you're moving in the right direction. You probably need to install VS if you haven't already (see the node-gyp README for details) and run vcvarsall.bat to configure the environment. |
@dotnetCarpenter npm ERR! not found: git So what i did is download the whole master branch to a local directory and point npm to that directory. Do i have to have a clean npm install of the original to do a nw-gyp rebuild ?? BTW i found a precompiles windows version, but dont know, and found no clues how to use the directory structure, which contains the .node files ? Thanks in advance |
@treh1966 You don't have git installed.
You probably need git to install from a local git repository. What happens when you do a standard install? I can see on the appveyor.com build log that Please check your PATH and that
|
Thanks @dotnetCarpenter and @mousetraps !! Installing the missing Windows 8.1 SDK did make it work. |
Installed both Windows 8.1 SDK and win 10 SDK... followed all the instructions and still not working Hadi@ThinkPad MINGW64 ~/Desktop/New folder/utf-8-validate (master)
$ npm i
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install th e latest version of pug instead of jade
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> utf-8-validate@1.2.1 install C:\Users\Hadi\Desktop\New folder\utf-8-validate
> node-gyp rebuild
C:\Users\Hadi\Desktop\New folder\utf-8-validate>if not defined npm_config_node_g yp (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.
validation.cc
win_delay_load_hook.c
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_loa d_hook.c(34): error C2373: '__pfnDliNotifyHook2': redefinition; different type m odifiers [C:\Users\Hadi\Desktop\New folder\utf-8-validate\build\validation.vcxpr oj]
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h(134) : note: see declaration of '__pfnDliNotifyHook2'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` fail ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\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_proces s.js:204:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Hadi\Desktop\New folder\utf-8-validate
gyp ERR! node -v v6.3.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ node_modules\\npm\\bin\\npm-cli.js" "i"
npm ERR! node v6.3.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! utf-8-validate@1.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the utf-8-validate@1.2.1 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 utf-8-validate packag e,
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 utf-8-validate
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls utf-8-validate
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Hadi\Desktop\New folder\utf-8-validate\npm-debug.log
|
@Almusamim you're running in to our __pfnDliNotifyHook2 problem which has been covered pretty extensively on this issue tracker (not that I'm suggesting it's easy to identify!). In order to use the latest release of Visual Studio 2015 you need to get the latest version of node-gyp which comes with the latest v2 and v3 releases of npm. You should be able to run |
@ dotnetCarpenter I am new to node js. I am running into the node-gyp errors this article described. My OS is Win8.1 and I have followed all the instructions but Step6/ in your guide at the beginning. For example, currently, after I have performed your step 1-5, I used this command, "npm install -g TheApp". How do I incorporate your step 6 into this install command? BTW, I have errors related to kerberos when I used the above generic install command which then led to the same node-gyp errors shown in this article. Please advise. Thanks in advance, |
Step 6 means everything is done and there should be no errors. If you are getting something else I'd file another bug. Kerberos errors suggest you might need proxy authentication to download stuff, I think this is out of scope of node-gyp |
Thank you all for paticipating the discussion and share your insights.
I also installed the other two, but I'm not sure if they were neccessary, which are
With other issues like Python version and PATH settings addressed, npm started to work normally. |
Just like WillingAC, I also followed the official document from Microsoft's Node.js Guidelines for Windows, but I am still having problems when I tried to compile the Couchbase SDK for node (couchnode). The errors I ran into are:
After some Google searches, I found that I needed to link to WS2_32.Lib. I checked the SDK folder under C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86 (and x64) and the file is there. So, somehow npm-gyp just couldn't pass the location to msbuild. I also tried setting an environment variable ILink_LibraryPath and pointed it to WS2_32.Lib before compiling the module, but it didn't help. I am at lost! |
@toyssamurai You should report that to the maintainers of the couchbase module, it's not a node-gyp issue. Make sure you're using the latest version, it might have been fixed already. |
I tired to find the MS standalone compiler, but when I opened the link it says the account expired. Is there any other link to download MS C++ standalone compiler. |
In VS2017 & VS2019 MS did not release a stand alone compiler. There is a CLI only "Built Tools" SKU at - https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16 |
I did all the tasks described above to recompile node-java, in order to install node-jdbc. But I sill fail, even though I did all the described measures above: installed python, have .Net 4.5.1, installed Visual Studio 2015, installed Build Tools, set "npm config -g set msvs_version 2015" and also tried many other measures described in other threads. gyp ERR! build error npm ERR! A complete log of this run can be found in: Has anybody an idea, what else I can do? Thanks for your help in advance! |
gyp ERR! build error
error Command failed with exit code 1. Anyone have any idea how to resolve this ? |
@bharathrajitagi The text at https://github.com/nodejs/node-gyp/issues/new has the answers. You are using node-gyp v3 when the current release is v8. https://github.com/nodejs/node-gyp/releases |
[EDIT]
Guide
1 Your OS MUST be Windows
2 Check that python is in your path by writting
python --version
in the console. If not then2.1 Download python 2.7 (I recommend chocolatey (
choco install python2 -y
))3. Are you on Windows 7? Then follow the rest of 3.x
3.1 Check that you have .NET 4.5.1+ installed. If not then
3.2 Download and install .NET 4.5.1 (.NET 4.5.2 will also work just fine)
4 Download Microsoft Visual C++ Build Tools 2015 Technical Preview
4.1 Install the Windows 8.1 SDK if you haven't already. Note; I recently updated to Windows 10 and had to install the Windows 10 SDK before
node-gyp
would successfully build.5 Set the npm config variable msvs_version to 2015:
npm config -g set msvs_version 2015
6 Do
npm i
in what-ever project withnode-gyp
as a dependency without seeing weird error messages 👍Tested with node 5.0.0+ and npm 3.3.6
thanks to @mousetraps
I happily noticed that MS provides a standalone c++ compiler. I will try to use it with node-gyp (via utf-8-validate) and report my findings here.
http://blogs.msdn.com/b/vcblog/archive/2015/11/02/announcing-visual-c-build-tools-2015-standalone-c-tools-for-build-environments.aspx
The text was updated successfully, but these errors were encountered: