barrysteyn / node-scrypt

Scrypt for Node
370 stars 88 forks source link

Error Installing scrypt in windows 10 #176

Open sivahanuman opened 6 years ago

sivahanuman commented 6 years ago

Hi,

I can't install scrypt in windows 10 , I am getting following error.

`$ npm install scrypt

scrypt@6.0.3 preinstall D:\solidity\inbox\node_modules\scrypt node node-scrypt-preinstall.js

scrypt@6.0.3 install D:\solidity\inbox\node_modules\scrypt node-gyp rebuild

D:\solidity\inbox\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\Users\siva.subramanian\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\siva.subramanian\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) Warning: Missing input files: D:\solidity\inbox\node_modules\scrypt\build..\scrypt\win\include\config.h Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. D:\solidity\inbox\node_modules\scrypt\build\copied_files.vcxproj(20,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. D:\solidity\inbox\node_modules\scrypt\build\scrypt_wrapper.vcxproj(20,3): error MSB4019: The imported project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. 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:\Users\siva.subramanian\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23) gyp ERR! stack at ChildProcess.emit (events.js:127:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12) gyp ERR! System Windows_NT 10.0.16299 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\siva.subramanian\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd D:\solidity\inbox\node_modules\scrypt gyp ERR! node -v v9.7.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok npm WARN webpack-cli@2.1.5 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN inbox@1.0.0 No description npm WARN inbox@1.0.0 No repository 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! C:\Users\siva.subramanian\AppData\Roaming\npm-cache_logs\2018-06-19T02_05_43_201Z-debug.log `

regattatropicals commented 6 years ago

On Windows 10, Scrypt is built using node-gyp, which can be acquired by globally installing Microsoft's Windows Build Tools, so install that first from an elevated PowerShell or CMD.exe (run as Administrator). npm install --global --production windows-build-tools It takes a while. Then get node-gyp: npm install -g node-gyp Then you should be able to run npm install scrypt This info comes from node-gyp's github page.

-Robert

sivahanuman commented 6 years ago

I have tried the command before post here , doesn't work

ml1nk commented 6 years ago

My last try with npm install --global --production windows-build-tools wasn't successful, too. I installed the build tools directly, then it worked.

Alternative this issue seems to address the same problem https://github.com/nodejs/node-gyp/issues/671

sivahanuman commented 6 years ago

I have tried directly install build tools before post here , doesn't work

sivahanuman commented 6 years ago

Hi, this is the error. machine configuration Windows 10 64 bit, Visual studio 2012 Visual Studio 2017 .net Frameworks 3.5 and 4.7,2 ( backward compatibility )

` $ npm install scrypt

scrypt@6.0.3 preinstall D:\solidity\inbox\node_modules\scrypt node node-scrypt-preinstall.js

scrypt@6.0.3 install D:\solidity\inbox\node_modules\scrypt node-gyp rebuild

D:\solidity\inbox\node_modules\scrypt>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 ) Warning: Missing input files: D:\solidity\inbox\node_modules\scrypt\build..\scrypt\win\include\config.h Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. D:\solidity\inbox\node_modules\scrypt\build\copied_files.vcxproj(20,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v110\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. D:\solidity\inbox\node_modules\scrypt\build\scrypt_wrapper.vcxproj(20,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v110\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. 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:258:23) gyp ERR! stack at ChildProcess.emit (events.js:127:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12) gyp ERR! System Windows_NT 10.0.16299 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 D:\solidity\inbox\node_modules\scrypt gyp ERR! node -v v9.7.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok npm WARN webpack-cli@2.1.5 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN inbox@1.0.0 No description npm WARN inbox@1.0.0 No repository 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! C:\Users\siva.subramanian\AppData\Roaming\npm-cache_logs\2018-06-20T06_10_33_432Z-debug.log

`

ml1nk commented 6 years ago

Something is probably wrong with your configuration, as error messages like

MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v110\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

leads to the issue in my previous post or pages like: https://www.codesd.com/item/why-does-msbuild-look-in-c-for-microsoft-cpp-default-props-instead-of-c-program-files-x86-msbuild-error-msb4019.html

sivahanuman commented 6 years ago

Nope doesn't help

sivahanuman commented 6 years ago

finally successfully installed

workaround

  1. reinstall vc++ build tools for vs2015

  2. Manually add the string value in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\MSBuild\ToolsVersions\14.0

key = VCTargetsPath
value = C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140

chrisveness commented 6 years ago

@sivahanuman if you are using Node v10.5.0 (current), scrypt has finally been released as part of the crypto module: I have written a zero-dependency npm module scrypt-kdf which you might find interesting as it has none of the issues of native abstractions, and which I would be glad for you to try out.

It has a slightly simplified API compared with this module (it is promise-based and interfaces with strings rather than buffers), but it operates on the same stored password hashes.

If you try it, let me know your experiences! @chrisveness

jaipraveen51 commented 6 years ago

@chrisveness

I tried to install scrypt-kdf but below error

image

My original intention was to npm install a github downloaded package related to ethereum/solidity

I encountered config.h missing input file error and I tried setting up windows-build-tools command and tried few other options, so far no luck.

Can you please advise? I have already posted a message at scrypt issue page yesterday.

0xAshish commented 6 years ago

@sivahanuman what's node -v

chrisveness commented 6 years ago

@jaipraveen51 I can't quite make sense of that screenshot, but it looks like errors coming from scrypt, rather than scrypt-kdf - try making sure scrypt is removed from package.json (with scrypt-kdf in its place), delete the node_modules directory, and run npm install again.

sriharikapu commented 5 years ago

This is crazy the node-gyp doesn't work at all. I tried all the ways. What all I tried:

  1. Python issue - install new python 2.7 and set path - still node-gpy it didn't work
  2. Install build tools from the VS - still node-gpy it didn't work
  3. Build build tools from the github - still node-gpy it didn't work
  4. Rebuild node-gyp - still node-gpy it didn't work
  5. Remove node-gyp and reinstall - still node-gpy it didn't work
  6. npm config set msvs_version 2013 --global - still node-gpy it didn't work
  7. VC++ doesnt work as well

image

scrypt@6.0.3 install:node-gyp rebuild Scrypt cannot be installed.

RIP

chrisveness commented 5 years ago

@sriharikapu, this repo is no longer maintained.

If you are using scrypt.hash, it is now available natively in the Node.js crypto module.

If you are using scrypt.kdf / scrypt.verifyKdf, scrypt-kdf is a close-to-direct replacement.

sriharikapu commented 5 years ago

@chrisveness I will check and get back to you

sriharikapu commented 5 years ago

I was using scrypt.hash

sriharikapu commented 5 years ago

same story on my other windows : tempsnip

chrisveness commented 5 years ago

@sriharikapu use crypto.scrypt() in Node 10.5.0+, or scrypt-async for Node < 10.5.0.

sriharikapu commented 5 years ago

I am currently using scrypt-async its not working with any node version for me on my windows.

japinzonn commented 5 years ago

Hi. I had the same problem. What I did was create the entire project by running the cmd command as administrator:

matsushou commented 5 years ago

Downgrading Node.js (npm) works for me.

ghost commented 4 years ago

Windows 10 64 bit Downgrade Node.js 12.13.0 to Node.js 10.17.0 works.

junsp commented 3 years ago

Windows 10 64 bit Downgrade Node.js 12.13.0 to Node.js 10.17.0 works.

Indeed this made my environment to pass the point of installing scrypt, which was somehow required for ethereum-alarm-clock