简体   繁体   中英

Unable to install node.js package 'scrypt' using npm on windows

Installing scrypt using npm on windows is giving following error. The build is failing due to node-gyp

在此处输入图片说明

From github documentation node-Gyp is listed as pre-requisite as it is required to build scrypt . Make it sure to install node-Gyp

using npm install -g node-gyp

For successfull working of this plugin you will also need to 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). for other options and alternatives follow node-gyp documentation

Before installing scrypt Follow installation instructions given at github

first you need to install windows-build-tools

run this command first

> npm install --global --production windows-build-tools

For NodeJS 10.5.0 and higher

My answer could be a little bit out of topic, but I encountered a similar error with the installation of the scrypt library for NodeJS v12 : during the compilation of the C/C++ modules with node-gyp a lot of compiling warnings and errors appear.

Though, there is an elegant solution.

Since version 10.5.0 NodeJS has a crypto.scrypt(...) function, which (with several other functions from crypto module) could cover almost all real use-cases.

So, a decent solution could sound like: Remove scrypt -package from your code and use the appropriate functions from the crypto -native module .

Sadly, but in most cases it is not the best solution for a real business

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM