Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing node-argon2 in Windows

Little background
I was trying to install node-argon2 but having trouble installing it. I've been trying to download GCC, I already installed node-gyp as in the docs said.

However I keep failing on this step..

CXX=g++-6 npm install argon2

I had no idea what that function did, and this what came out when I tried to launch that in my terminal.

> [email protected] install C:\Users\BizCon\Projects\express-ticket\node_modules\argon2
> node-gyp rebuild


C:\Users\BizCon\Projects\express-ticket\node_modules\argon2>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\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\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\BizCon\Projects\express-ticket\node_modules\argon2\build\libargon2.vcxproj]
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 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262: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 Windows_NT 10.0.17134
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"
gyp ERR! cwd C:\Users\BizCon\Projects\express-ticket\node_modules\argon2
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] requires a peer of @babel/core@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@>=2 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
like image 929
Irfandy Jip Avatar asked Mar 16 '19 13:03

Irfandy Jip


1 Answers

I was so careless at the time I asked this. I hope for whoever you are that goes to this forum have done the step on node-gyp repository carefully.

You see this is the Installation Guide of node-gyp for Windows

There are two options. Just use the first one!

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).

Yes, this one npm install --global --production windows-build-tools

I was so noob at the time, I read that as 'npm install --global--production windows-build-tools'. And whalaaa! I can use node-argon2 now. HAHAHAHAHAHAHAHA.

like image 188
Irfandy Jip Avatar answered Oct 24 '22 04:10

Irfandy Jip