bcrypt is crashing the app while generating salt or hashed password











up vote
-1
down vote

favorite
2












As per the bcrypt npm documentation I tried to incorporate the package but unable to use bcrypt package in my app, so to test the bcrypt separately I created sample js file which is also crashing on execution without giving any error. Below is the js file which I tried to test. I tried to pass the constant value to hash function, which is also not working.



const bcrypt = require('bcrypt');
async function run(){
const saltValue =await bcrypt.genSalt(10);
bcrypt.hash('12345',saltValue)
.then(result => console.log(result))
.catch(error => console.log(error));
}
run();


Version:
node : 9.0.0
npm: '5.5.1'
"bcrypt": "^3.0.2",



With nodemon, I am getting message: app crashed - waiting for file changes before starting...
in normal execution it is not showing any error.



Update:



If change the bcrypt's async methods with synchronous then it is working fine,



    const saltValue = bcrypt.genSaltSync(10);
const hashed = bcrypt.hashSync('12345',saltValue);


I think someone from bcrypt team can answer.



Update: This issue raised on the community and few other developers are facing the same issue, for more information you can refer the link.



https://github.com/kelektiv/node.bcrypt.js/issues/674










share|improve this question
























  • What's the error message?
    – Darkrum
    Nov 12 at 1:08










  • app crashed - waiting for file changes before starting... As i have mentioned in the question it is crashing without giving any error:
    – ironman
    Nov 12 at 1:08












  • If I execute it with node then it crashed without showing any error or any message like app crashed.
    – ironman
    Nov 12 at 1:10






  • 1




    If there's no error then it completed it's execution. Node will exit after running a file.
    – Darkrum
    Nov 12 at 1:11










  • I know, but I am not getting any output and the message is also showing app crashed. If I comment the two lines which are using bcrypt then the function is executing without crashing application.
    – ironman
    Nov 12 at 1:13















up vote
-1
down vote

favorite
2












As per the bcrypt npm documentation I tried to incorporate the package but unable to use bcrypt package in my app, so to test the bcrypt separately I created sample js file which is also crashing on execution without giving any error. Below is the js file which I tried to test. I tried to pass the constant value to hash function, which is also not working.



const bcrypt = require('bcrypt');
async function run(){
const saltValue =await bcrypt.genSalt(10);
bcrypt.hash('12345',saltValue)
.then(result => console.log(result))
.catch(error => console.log(error));
}
run();


Version:
node : 9.0.0
npm: '5.5.1'
"bcrypt": "^3.0.2",



With nodemon, I am getting message: app crashed - waiting for file changes before starting...
in normal execution it is not showing any error.



Update:



If change the bcrypt's async methods with synchronous then it is working fine,



    const saltValue = bcrypt.genSaltSync(10);
const hashed = bcrypt.hashSync('12345',saltValue);


I think someone from bcrypt team can answer.



Update: This issue raised on the community and few other developers are facing the same issue, for more information you can refer the link.



https://github.com/kelektiv/node.bcrypt.js/issues/674










share|improve this question
























  • What's the error message?
    – Darkrum
    Nov 12 at 1:08










  • app crashed - waiting for file changes before starting... As i have mentioned in the question it is crashing without giving any error:
    – ironman
    Nov 12 at 1:08












  • If I execute it with node then it crashed without showing any error or any message like app crashed.
    – ironman
    Nov 12 at 1:10






  • 1




    If there's no error then it completed it's execution. Node will exit after running a file.
    – Darkrum
    Nov 12 at 1:11










  • I know, but I am not getting any output and the message is also showing app crashed. If I comment the two lines which are using bcrypt then the function is executing without crashing application.
    – ironman
    Nov 12 at 1:13













up vote
-1
down vote

favorite
2









up vote
-1
down vote

favorite
2






2





As per the bcrypt npm documentation I tried to incorporate the package but unable to use bcrypt package in my app, so to test the bcrypt separately I created sample js file which is also crashing on execution without giving any error. Below is the js file which I tried to test. I tried to pass the constant value to hash function, which is also not working.



const bcrypt = require('bcrypt');
async function run(){
const saltValue =await bcrypt.genSalt(10);
bcrypt.hash('12345',saltValue)
.then(result => console.log(result))
.catch(error => console.log(error));
}
run();


Version:
node : 9.0.0
npm: '5.5.1'
"bcrypt": "^3.0.2",



With nodemon, I am getting message: app crashed - waiting for file changes before starting...
in normal execution it is not showing any error.



Update:



If change the bcrypt's async methods with synchronous then it is working fine,



    const saltValue = bcrypt.genSaltSync(10);
const hashed = bcrypt.hashSync('12345',saltValue);


I think someone from bcrypt team can answer.



Update: This issue raised on the community and few other developers are facing the same issue, for more information you can refer the link.



https://github.com/kelektiv/node.bcrypt.js/issues/674










share|improve this question















As per the bcrypt npm documentation I tried to incorporate the package but unable to use bcrypt package in my app, so to test the bcrypt separately I created sample js file which is also crashing on execution without giving any error. Below is the js file which I tried to test. I tried to pass the constant value to hash function, which is also not working.



const bcrypt = require('bcrypt');
async function run(){
const saltValue =await bcrypt.genSalt(10);
bcrypt.hash('12345',saltValue)
.then(result => console.log(result))
.catch(error => console.log(error));
}
run();


Version:
node : 9.0.0
npm: '5.5.1'
"bcrypt": "^3.0.2",



With nodemon, I am getting message: app crashed - waiting for file changes before starting...
in normal execution it is not showing any error.



Update:



If change the bcrypt's async methods with synchronous then it is working fine,



    const saltValue = bcrypt.genSaltSync(10);
const hashed = bcrypt.hashSync('12345',saltValue);


I think someone from bcrypt team can answer.



Update: This issue raised on the community and few other developers are facing the same issue, for more information you can refer the link.



https://github.com/kelektiv/node.bcrypt.js/issues/674







node.js npm bcrypt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 6 at 1:59

























asked Nov 12 at 1:04









ironman

9439




9439












  • What's the error message?
    – Darkrum
    Nov 12 at 1:08










  • app crashed - waiting for file changes before starting... As i have mentioned in the question it is crashing without giving any error:
    – ironman
    Nov 12 at 1:08












  • If I execute it with node then it crashed without showing any error or any message like app crashed.
    – ironman
    Nov 12 at 1:10






  • 1




    If there's no error then it completed it's execution. Node will exit after running a file.
    – Darkrum
    Nov 12 at 1:11










  • I know, but I am not getting any output and the message is also showing app crashed. If I comment the two lines which are using bcrypt then the function is executing without crashing application.
    – ironman
    Nov 12 at 1:13


















  • What's the error message?
    – Darkrum
    Nov 12 at 1:08










  • app crashed - waiting for file changes before starting... As i have mentioned in the question it is crashing without giving any error:
    – ironman
    Nov 12 at 1:08












  • If I execute it with node then it crashed without showing any error or any message like app crashed.
    – ironman
    Nov 12 at 1:10






  • 1




    If there's no error then it completed it's execution. Node will exit after running a file.
    – Darkrum
    Nov 12 at 1:11










  • I know, but I am not getting any output and the message is also showing app crashed. If I comment the two lines which are using bcrypt then the function is executing without crashing application.
    – ironman
    Nov 12 at 1:13
















What's the error message?
– Darkrum
Nov 12 at 1:08




What's the error message?
– Darkrum
Nov 12 at 1:08












app crashed - waiting for file changes before starting... As i have mentioned in the question it is crashing without giving any error:
– ironman
Nov 12 at 1:08






app crashed - waiting for file changes before starting... As i have mentioned in the question it is crashing without giving any error:
– ironman
Nov 12 at 1:08














If I execute it with node then it crashed without showing any error or any message like app crashed.
– ironman
Nov 12 at 1:10




If I execute it with node then it crashed without showing any error or any message like app crashed.
– ironman
Nov 12 at 1:10




1




1




If there's no error then it completed it's execution. Node will exit after running a file.
– Darkrum
Nov 12 at 1:11




If there's no error then it completed it's execution. Node will exit after running a file.
– Darkrum
Nov 12 at 1:11












I know, but I am not getting any output and the message is also showing app crashed. If I comment the two lines which are using bcrypt then the function is executing without crashing application.
– ironman
Nov 12 at 1:13




I know, but I am not getting any output and the message is also showing app crashed. If I comment the two lines which are using bcrypt then the function is executing without crashing application.
– ironman
Nov 12 at 1:13












1 Answer
1






active

oldest

votes

















up vote
0
down vote













bcrypt can be funky sometimes... replace with bcryptjs (far more popular anyway...)



This works just fine:



const bcrypt = require('bcryptjs');

async function run() {
const saltValue = await bcrypt.genSalt(10);
bcrypt
.hash('12345', saltValue)
.then(result => console.log(result))
.catch(error => console.log(error));
}
run();





share|improve this answer





















  • I think node.bcrypt.js and bcryptjs are two different packages.
    – ironman
    Nov 12 at 1:41










  • There are a bunch... Which one are you using specifically? Can you link to the npm package here?
    – SakoBu
    Nov 12 at 1:42










  • @ironman they are but they accomplish the same thing. bcryptjs is just pure JavaScript implementation. No dependencies like the one your using.
    – Darkrum
    Nov 12 at 1:42












  • I am using npmjs.com/package/bcrypt.
    – ironman
    Nov 12 at 1:43










  • @ironman yes we know but Sakobu is right bcrypt does have issues across different platforms because it is complied. Memory serves me I was having issues with it when working on a raspberry pi so I used the pure JavaScript library instead.
    – Darkrum
    Nov 12 at 1:46











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53254805%2fbcrypt-is-crashing-the-app-while-generating-salt-or-hashed-password%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













bcrypt can be funky sometimes... replace with bcryptjs (far more popular anyway...)



This works just fine:



const bcrypt = require('bcryptjs');

async function run() {
const saltValue = await bcrypt.genSalt(10);
bcrypt
.hash('12345', saltValue)
.then(result => console.log(result))
.catch(error => console.log(error));
}
run();





share|improve this answer





















  • I think node.bcrypt.js and bcryptjs are two different packages.
    – ironman
    Nov 12 at 1:41










  • There are a bunch... Which one are you using specifically? Can you link to the npm package here?
    – SakoBu
    Nov 12 at 1:42










  • @ironman they are but they accomplish the same thing. bcryptjs is just pure JavaScript implementation. No dependencies like the one your using.
    – Darkrum
    Nov 12 at 1:42












  • I am using npmjs.com/package/bcrypt.
    – ironman
    Nov 12 at 1:43










  • @ironman yes we know but Sakobu is right bcrypt does have issues across different platforms because it is complied. Memory serves me I was having issues with it when working on a raspberry pi so I used the pure JavaScript library instead.
    – Darkrum
    Nov 12 at 1:46















up vote
0
down vote













bcrypt can be funky sometimes... replace with bcryptjs (far more popular anyway...)



This works just fine:



const bcrypt = require('bcryptjs');

async function run() {
const saltValue = await bcrypt.genSalt(10);
bcrypt
.hash('12345', saltValue)
.then(result => console.log(result))
.catch(error => console.log(error));
}
run();





share|improve this answer





















  • I think node.bcrypt.js and bcryptjs are two different packages.
    – ironman
    Nov 12 at 1:41










  • There are a bunch... Which one are you using specifically? Can you link to the npm package here?
    – SakoBu
    Nov 12 at 1:42










  • @ironman they are but they accomplish the same thing. bcryptjs is just pure JavaScript implementation. No dependencies like the one your using.
    – Darkrum
    Nov 12 at 1:42












  • I am using npmjs.com/package/bcrypt.
    – ironman
    Nov 12 at 1:43










  • @ironman yes we know but Sakobu is right bcrypt does have issues across different platforms because it is complied. Memory serves me I was having issues with it when working on a raspberry pi so I used the pure JavaScript library instead.
    – Darkrum
    Nov 12 at 1:46













up vote
0
down vote










up vote
0
down vote









bcrypt can be funky sometimes... replace with bcryptjs (far more popular anyway...)



This works just fine:



const bcrypt = require('bcryptjs');

async function run() {
const saltValue = await bcrypt.genSalt(10);
bcrypt
.hash('12345', saltValue)
.then(result => console.log(result))
.catch(error => console.log(error));
}
run();





share|improve this answer












bcrypt can be funky sometimes... replace with bcryptjs (far more popular anyway...)



This works just fine:



const bcrypt = require('bcryptjs');

async function run() {
const saltValue = await bcrypt.genSalt(10);
bcrypt
.hash('12345', saltValue)
.then(result => console.log(result))
.catch(error => console.log(error));
}
run();






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 12 at 1:36









SakoBu

788317




788317












  • I think node.bcrypt.js and bcryptjs are two different packages.
    – ironman
    Nov 12 at 1:41










  • There are a bunch... Which one are you using specifically? Can you link to the npm package here?
    – SakoBu
    Nov 12 at 1:42










  • @ironman they are but they accomplish the same thing. bcryptjs is just pure JavaScript implementation. No dependencies like the one your using.
    – Darkrum
    Nov 12 at 1:42












  • I am using npmjs.com/package/bcrypt.
    – ironman
    Nov 12 at 1:43










  • @ironman yes we know but Sakobu is right bcrypt does have issues across different platforms because it is complied. Memory serves me I was having issues with it when working on a raspberry pi so I used the pure JavaScript library instead.
    – Darkrum
    Nov 12 at 1:46


















  • I think node.bcrypt.js and bcryptjs are two different packages.
    – ironman
    Nov 12 at 1:41










  • There are a bunch... Which one are you using specifically? Can you link to the npm package here?
    – SakoBu
    Nov 12 at 1:42










  • @ironman they are but they accomplish the same thing. bcryptjs is just pure JavaScript implementation. No dependencies like the one your using.
    – Darkrum
    Nov 12 at 1:42












  • I am using npmjs.com/package/bcrypt.
    – ironman
    Nov 12 at 1:43










  • @ironman yes we know but Sakobu is right bcrypt does have issues across different platforms because it is complied. Memory serves me I was having issues with it when working on a raspberry pi so I used the pure JavaScript library instead.
    – Darkrum
    Nov 12 at 1:46
















I think node.bcrypt.js and bcryptjs are two different packages.
– ironman
Nov 12 at 1:41




I think node.bcrypt.js and bcryptjs are two different packages.
– ironman
Nov 12 at 1:41












There are a bunch... Which one are you using specifically? Can you link to the npm package here?
– SakoBu
Nov 12 at 1:42




There are a bunch... Which one are you using specifically? Can you link to the npm package here?
– SakoBu
Nov 12 at 1:42












@ironman they are but they accomplish the same thing. bcryptjs is just pure JavaScript implementation. No dependencies like the one your using.
– Darkrum
Nov 12 at 1:42






@ironman they are but they accomplish the same thing. bcryptjs is just pure JavaScript implementation. No dependencies like the one your using.
– Darkrum
Nov 12 at 1:42














I am using npmjs.com/package/bcrypt.
– ironman
Nov 12 at 1:43




I am using npmjs.com/package/bcrypt.
– ironman
Nov 12 at 1:43












@ironman yes we know but Sakobu is right bcrypt does have issues across different platforms because it is complied. Memory serves me I was having issues with it when working on a raspberry pi so I used the pure JavaScript library instead.
– Darkrum
Nov 12 at 1:46




@ironman yes we know but Sakobu is right bcrypt does have issues across different platforms because it is complied. Memory serves me I was having issues with it when working on a raspberry pi so I used the pure JavaScript library instead.
– Darkrum
Nov 12 at 1:46


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53254805%2fbcrypt-is-crashing-the-app-while-generating-salt-or-hashed-password%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Guess what letter conforming each word

Port of Spain

Run scheduled task as local user group (not BUILTIN)