I was trying to transfer some ether using ganache desktop application in nodejs. It was properly working but suddenly an error occurred.
var s = 1;
try{
web3.eth.sendTransaction({
from: '0x627306090abaB3A6e1400e9345bC60c78a8BEf57',
to:'0x821aea9a577a9b44299b9c15c88cf3087f3b5544',
value: web3.toWei(s.toString(), "ether")
}).then(function(receipt) {
console.log(receipt);
res.json({success: true});
}).catch(function(e){
console.log('error occured');
console.log(e);
res.json({success: false });
});
If .then() and .catch() is removed, ether is transferred.