Re: amber init giving a "UnhandledPromiseRejectionWarning: Error: Cannot find module 'grunt-init/package.json'" error

Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: amber init giving a "UnhandledPromiseRejectionWarning: Error: Cannot find module 'grunt-init/package.json'" error

Herby Vojčík
On 27. 4. 2019 17:50, [hidden email] wrote:
> I am installing amber to a code directory. However, it keeps telling me:
> JavaScript exception: Error: Cannot find module 'grunt-init/package.json'
> (node:31888) UnhandledPromiseRejectionWarning: Error: Cannot find module
> 'grunt-init/package.json'
>
> I did a "npm install grunt" thinking that's what it needed, but it still
> complains that I don't have it installed. I am runnign ubuntu 18.04 and
> npm 3.5.2. full error is here:
> Welcome to Amber CLI version 0.101.0 (Amber 0.18.5, NodeJS 8.10.0).

0.101 is very old. Likely before moving to @ambers npm org. What
instructions did you use to install the CLI? The correct, up to date
ones are in lolg.it/amber/amber.

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: amber init giving a "UnhandledPromiseRejectionWarning: Error: Cannot find module 'grunt-init/package.json'" error

Herby Vojčík
On 29. 4. 2019 17:53, [hidden email] wrote:
>  > 0.101 is very old. Likely before moving to @ambers npm org. What
>  > instructions did you use to install the CLI? The correct, up to date
>  > ones are in lolg.it/amber/amber.
>
> I followed the instructions here:
> https://docs.amber-lang.net/installing-amber.html?? . The only command I
> issued was: "npm install-gamber-cli" . It is somehow installing amber
> .101. Maybe I am using an old version of npm? I am using 3.5.2 on Ubuntu
> 18.04.

I have written, above, "the correct, up to date [instructions] are on
lolg.it/amber/amber".

Did I phrased it wrong, so it didn't get through somehow?

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: amber init giving a "UnhandledPromiseRejectionWarning: Error: Cannot find module 'grunt-init/package.json'" error

larryhems
UnhandledPromiseRejectionWarning originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). A rejected promise is like an exception that bubbles up towards the application entry point and causes the root error handler to produce that output. It usually happens in async await functions, and there's an easy fix.

const functionName = async (arguments) => {
  try {
  // Your code here
  } catch (error) {
  // Handle rejection here
  }
};

A nice way to wait for several Promises to resolve to use the Promise.all function. It expects an Array of Promises, and produces a Promise that resolves to an Array containing the values that the individual Promises resolved to. Furthermore, it only resolves after the last Promise resolves. If any of its input Promises rejects, then the entire Promise.all expression rejects as well. It effectively "runs" all of its input processes "at the same time", emulating the classic "fork-join" pattern.