0
votes

I'm trying to construct hyperledger fabric blockchain application. When I want to wake up the blockchain with npm:npm run env:restart, I get the following error:

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Errors found in script, stopping execution (node:4432) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

How can i fix this?

my nvm version: 5.6.0 my nodejs version: 8.16.0

1

1 Answers

0
votes

You are missing a catch block in a promise chain in your code.

Add it like this:

var p1 = new Promise(function(resolve, reject) {
  throw new Error('Uh-oh!');
});

p1.catch(function(e) {
  console.log(e); // "Uh-oh!"
});

For more information on Promises and catch block specifically, refer MDN.