๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ’Ž/Node.js

์œˆ๋„์šฐ10 bcrypt ์„ค์น˜ ์˜ค๋ฅ˜ ํ•ด๊ฒฐํ•˜๊ธฐ

by dar0m! 2019. 5. 28.

ํ•ด๊ฒฐ๋ฐฉ๋ฒ•๋งŒ ๋ณด๋ ค๋ฉด (3) ์„ ์ฐธ๊ณ ํ•˜์„ธ์š”

 

(1) npm i bcrypt ์˜ค๋ฅ˜

> npm i bcrypt

๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ์Ÿ์•„์ ธ ๋‚ด๋ ธ๋‹ค. ๋ช…๋ นํ”„๋กฌํ”„ํŠธ ๊ด€๋ฆฌ์ž๋ชจ๋“œ๋กœ ์‹คํ–‰ํ•ด๋„ ๋งˆ์ฐฌ๊ฐ€์ง€.

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v72-win32-x64-unknown.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@12.2.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp) 
gyp ERR! configure error

 

(2) ํ•ด๊ฒฐ๊ณผ์ •

1. npm install --global --production windows-build-tools

๋ฏธ์นœ๋“ฏ์ด ๊ตฌ๊ธ€๋ง์„ ํ•˜์—ฌ ์ฐพ์•„๋‚ธ ๋ธ”๋กœ๊ทธ์—์„œ ํ•ด๋‹ต์„ ์–ป์„ ์ˆ˜ ์žˆ์—ˆ๋‹ค. (๋งฅ์ด๋‚˜ ๋ฆฌ๋ˆ…์Šค ํ™˜๊ฒฝ์€ ์•„๋ž˜ ๋งํฌ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.)

https://jongwony.tistory.com/16

 

bcrypt ์„ค์น˜์‹œ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ

Designed by Freepik node-pre-gyp ERR! ๋ฌธ์ œ npm์œผ๋กœ bcrypt ์„ค์น˜์‹œ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 $ npm install -s bcrypt > bcrypt@3.0.3 in..

jongwony.tistory.com

 

์œˆ๋„์šฐ์˜ ๊ฒฝ์šฐ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ๋ช…๋ นํ”„๋กฌํ”„ํŠธ ๊ด€๋ฆฌ์ž๋ชจ๋“œ์—์„œ ์‹คํ–‰ํ•˜๋ฉด ํŒŒ์ด์ฌ๋“ฑ ํ•„์š”ํ•œ ๋„๊ตฌ๋ฅผ ์„ค์น˜ํ•ด์ค€๋‹ค.

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

 ์ค‘๊ฐ„์— ์—”ํ„ฐ๋ฅผ ๋ˆ„๋ฅด๊ณ  ๊ณ„์†ํ•ด์„œ ๊ธฐ๋‹ค๋ฆฌ๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ๊ธ€์ด ๋‚˜ํƒ€๋‚ฌ๋‹ค. 

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
---------- Visual Studio Build Tools ----------
2019-05-28T23:32:51 : Verbose : [InstalledProductsProviderImpl]: Stream was closed
2019-05-28T23:32:51 : Verbose : [InstallerImpl]: Rpc connection was closed.
2019-05-28T23:32:51 : Verbose : [InstallerImpl]: Stream was closed
2019-05-28T23:32:52 : Verbose : Completed notifying all clients that the update is starting
2019-05-28T23:32:52 : Verbose : Updating installer [bootstrapperArguments: /finalizeInstall install --in C:\ProgramData\Microsoft\VisualStudio\Packages\_bootstrapper\vs_setup_bootstrapper_201905282332298540.json --norestart --quiet --includeRecommended --add Microsoft.VisualStudio.Workload.VCTools --locale ko-KR --activityId b92d1533-9c99-42f4-91bd-32c3d62bf49c]
------------------- Python --------------------
Successfully installed Python 2.7

๋ช…๋ นํ”„๋กฌํ”„ํŠธ๊ฐ€ ๊ทธ๋Œ€๋กœ ๋ฉˆ์ถฐ์„œ ๋‹ค์‹œ ์‹คํ–‰ํ•˜๊ณ  bcrypt๋ฅผ ์„ค์น˜ํ•ด ๋ดค๋‹ค.

> npm i bcrypt 

๋˜ ์˜ค๋ฅ˜๋‚จ;;

 

๋‹ค์‹œ ๋ช…๋ นํ”„๋กฌํ”„ํŠธ๋ฅผ ๊ด€๋ฆฌ์ž๊ถŒํ•œ์œผ๋กœ ์‹คํ–‰ํ•˜๊ณ  

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

๋ฅผ ๋‹ค์‹œํ–ˆ๋‹ค.

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!

Status from the installers:
---------- Visual Studio Build Tools ----------
Successfully installed Visual Studio Build Tools.
------------------- Python --------------------
Action ended 23:54:59: CostInitialize. Return value 1.
Action start 23:54:59: FileCost.
Action ended 23:54:59: FileCost. Return value 1.
Action start 23:54:59: IsolateComponents.
Action ended 23:54:59: IsolateComponents. Return value 1.

Now configuring the Visual Studio Build Tools and Python...

All done!

+ windows-build-tools@5.1.0
added 145 packages from 99 contributors in 22.871s

์•„๊นŒ์™€ ๋‹ฌ๋ฆฌ ์ œ๋Œ€๋กœ ๋๋‚ฌ์Œ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

๋‹ค์‹œ npm i bcrypt ๋ฅผ ํ•ด๋ดค๋‹ค.

 

์‹คํŒจ...

 

2. npm install bcrypt --build-from-source

๋ชจ๋“ˆ์„ ์„ค์น˜ํ•˜๊ธฐ ์œ„ํ•ด ๋ฏธ๋ฆฌ ์ž‘์„ฑ๋œ ๋ฐ”์ด๋„ˆ๋ฆฌ๋ฅผ ๋‹ค์šด๋กœ๋“œํ•ด์•ผํ•œ๋‹ค๋Š” ๊ฒฝ๊ณ ์ž…๋‹ˆ๋‹ค.

Visual Studio๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด npm install [bcrypt] --build-from-source๋” ์•ˆ์ „ํ•œ ์˜ต์…˜ ์ธ ์‹œ๋„ํ•ด๋ณด์‹ญ์‹œ์˜ค .

์ถœ์ฒ˜: https://stackoverflow.com/questions/52728234/npm-problem-node-pre-gyp-using-request-for-node-pre-gyp-https-download

 

NPM PROBLEM: Node-pre-gyp. Using request for node-pre-gyp https download

I am creating Angular project and using Express.js as back-end and SQLite3 for database. When I am installing sqlite3 via command npm install sqlite3 I'm getting following error in the console. How...

stackoverflow.com

์‹คํŒจ.

 

(3) ํ•ด๊ฒฐ

์กฐ๋งŒ๊ฐ„ ๊ผญ ์ฑ„์šฐ๊ธธ..

1. ๋…ธ๋“œ 10๋ฒ„์ „, bcrypt 3๋ฒ„์ „์„ ์„ค์น˜ํ•œ๋‹ค.

๊ฐ•์˜ Q&A ์ฐพ๋‹ค๊ฐ€ ๋ฐœ๊ฒฌํ•œ ๋‹ต๊ธ€.

ํ•˜์ง€๋งŒ ๋‚œ node 12.2.0 ์ด๊ณ , ์œˆ๋„์šฐ์—์„œ ๋…ธ๋“œ ๋‹ค์šด๊ทธ๋ ˆ์ด๋“œํ•˜๋Š” ๋ฒ•์„ ์ฐพ์•„๋ดค์ง€๋งŒ ์–ด๋ ค์šด๊ฑฐ ๊ฐ™์•„์„œ ํฌ๊ธฐ. ์ง€์› ๋‹ค๊ฐ€ ๋‹ค์‹œ ์„ค์น˜ํ•˜๊ธฐ์—” ์ž˜๋ชป๋ ๊นŒ๋ด ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์„ ์ฐพ๊ธฐ ์œ„ํ•˜์—ฌ ๊ฒ€์ƒ‰์‹œ์ž‘.

 

2. bycryptjs ์„ค์น˜

 

bcryptjs

Optimized bcrypt in plain JavaScript with zero dependencies. Compatible to 'bcrypt'.

www.npmjs.com

 

ํ‚ค์›Œ๋“œ๋Š” '๋…ธ๋“œ๋ฒ„์ „ 12 bcrypt' ๋กœ ๊ฒ€์ƒ‰ํ•จ. ์•„๋ž˜์˜ ๊ธ€์„ ์ฐพ์•˜๊ณ 

https://codeday.me/ko/qa/20190322/125110.html

 

node.js – npm์œผ๋กœ bcrypt๋ฅผ ์„ค์น˜ํ•˜๋Š” ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. - ์ฝ”๋“œ ๋กœ๊ทธ

๋‹ค์Œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ ๋‚ด ์ปดํ“จํ„ฐ์— npm์„ ์‚ฌ์šฉํ•˜์—ฌ bcrypt์„ ์„ค์น˜ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ํ–‰์šด์„ ๋นŒ์–ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. npm์ด ์„ฑ๊ณต์ ์œผ๋กœ bcrypt๋ฅผ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋„๋ก ๋ฌธ์ œ๋ฅผ ์ง„๋‹จํ•˜๊ฑฐ๋‚˜ ์ˆ˜์ •ํ•˜๊ธฐ์œ„ํ•œ ๋‹จ๊ณ„๋ฅผ ๊ถŒ์žฅ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? Someones-Macbook:node_modules Cody$ npm install bcrypt npm WARN package.json grunt-contrib-htmlmin@0.1.3 No README data |

codeday.me

๋ช…๋ นํ”„๋กฌํ”„ํŠธ์—์„œ bcryptjs๋ฅผ ์„ค์น˜ํ•˜์˜€๋‹ค.

npm install --save bcryptjs

๊ฒฝ๊ณ ๊ฐ€ ๋œจ์ง€๋งŒ ์„ค์น˜๋Š” ๋˜์—ˆ๋‹ค.

node_modules ์•„๋ž˜์— bcryptjs ๋ผ๋Š” ํด๋”๊ฐ€ ์ƒ์„ฑ๋˜์—ˆ๊ณ 

์ž๋™์™„์„ฑ์œผ๋กœ๋„ bcryptjs๊ฐ€ ์žˆ๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

์‚ฌ์šฉ๋ฐฉ๋ฒ•์€ bcrypt์™€ ๊ฐ™๋‹ค๊ณ  ํ•˜๋‹ˆ bcrypt๊ฐ€ ๋“ค์–ด๊ฐ€๋Š” ๊ณณ์— bcryptjs๋ฅผ ์“ฐ๋ฉด ๋˜๊ฒ ๋‹ค.

 

๋!

๋Œ“๊ธ€