Error on install webiny

Hi, I’m new to webiny.

I follow the instruction here

But I’ve blocked on step 2, it seems never end on “Installing dependencies…”
How can I solve?

[email protected]:/# node -v
v10.18.1
[email protected]:/# npm -v
6.13.4
[email protected]:/# npm install -g [email protected]
/usr/bin/yarn -> /usr/lib/node_modules/yarn/bin/yarn.js
/usr/bin/yarnpkg -> /usr/lib/node_modules/yarn/bin/yarn.js
+ [email protected]
added 1 package from 1 contributor in 0.418s
[email protected]:/# yarn --version
2.0.0-rc.27
[email protected]:/# npm -g install @webiny/cli
/usr/bin/webiny -> /usr/lib/node_modules/@webiny/cli/bin.js
/usr/bin/wby -> /usr/lib/node_modules/@webiny/cli/bin.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@webiny/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @webiny/[email protected]
added 281 packages from 179 contributors in 17.612s
[email protected]:/# webiny create my-project

Webiny collects anonymous usage analytics to help improve the developer experience.
If you'd like to opt-out run webiny disable-tracking.
To learn more, check out https://www.webiny.com/telemetry/.

📦 Creating a new Webiny project in /my-project...
✔ Finished loading package versions
⠇ Installing dependencies...(node:4090) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 1 (EPERM): yarn
    at makeError (/usr/lib/node_modules/@webiny/cli/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/usr/lib/node_modules/@webiny/cli/node_modules/execa/index.js:112:26)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:4090) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4090) [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.
⠧ Installing dependencies...

Hey @mary, I suspect it’s the [email protected] that is causing the problem. We haven’t yet tested the new yarn as it is still in a release candidate state. Once it goes stable, we’ll test it and release an update.

At this point, I suggest you install any ^1 version of yarn, and it should work fine.

Let us know how it goes :slight_smile:

Thanks, step 2 is done when using yarn v1.

But I’ve been blocked on step 3, because it seems using AWS is necessary.

How can I make ready webiny with local mongodb?

AWS account IS necessary. That’s what Webiny is all about - cloud native development. You can develop React locally, but even for that you need to deploy your API to AWS.

From documentation of webiny, I notice that webiny depends on mongodb in AWS. Is it what you mean on “AWS account”?

Would your brief explain why AWS account is necessary?

Actually Mongo is the only non-serverless part of our current setup. You can have your MongoDB anywhere - but it has to be accessible from Lambda functions, meaning you can’t have it locally. There are some discussions about DynamoDB, but that is not on our priority list at the moment.

The AWS account is necessary because everything is deployed to AWS. Webiny uses S3 for files, Lambdas for API and React server-side-rendering, API Gateway and CloudFront. The deploy is performed using Serverless Components.

Hi @mary,

I think I was as much confused on the beginning of my journey with Webiny as you are right now. The keyword “local” in the name “local deployment” made me think “everything will work on my local machine”. That’s not true.

Quick explanation

AWS account is required to create all the Webiny backend. You have to have .aws/config and .aws/credentials files. You also have to have access to MongoDB database. I’m using MongoDB Atlas which provides free tier.

I made a short and oversimplified infographic that explains what is happening when you run webiny deploy-api on your machine.

Please open the image in new tab as some elements are not loaded in the thumbnail.

FAQ

Do I have to pay for the resources that the Webiny will create?
Yes

How much?
From my experience, having one production environment permanently deployed and couple of development environments being deployed and destroyed every couple of days in Mumbai (ap-south-1) I was paying about 20 cents a month.

Longer explanation

Webiny is designed to use AWS Lambda, Api Gateway, Cloudfront, S3 Cognito and so on as a backend. You can’t easily provision these services on your local machine that’s why the deployment have to be done on AWS.

  • “local” deployment means:
    • all the backend services runs on AWS and frontend applications - on your local machine. Running yarn start in admin/ and site/ app directories allows these frontend apps to become accessible on your machine under http://localhost:3000 and http://localhost:3001
    • as you deploy only backend on AWS you have to just run webiny deploy-api with no --env parameter
  • everything-else-than-local deployment means:
    • backend and frontend is being deployed on AWS. Frontend requires extra API Gateway, extra Cloudfront record that will provide you https:// address to be accessible globally and Lambda function for each application.
    • you run webiny deploy-api --env=<env name here> and webiny deploy-apps --env=<env name here>

Hope that will shed some light on the way the Webiny works :flashlight:

As I am just AWS cloud admin I’m happy to correct this description with Webiny developers’ help :wink:

2 Likes

Wow @Peter_Palka :smile:You nailed it! There’s only one minor thing I would change in the diagram to make it even more clear how DB is accessed: the connection to DB goes from Lambda to Mongo. Local Webiny never connects to your DB, that’s why IP whitelist is necessary; Lambdas always run under a different IP address.

Thanks for providing such detailed explanation! :rocket: :heart:

Thanks for the tip @pavel, I didn’t think about the way the Webiny is connected to the database. I’ve just fixed the infographic

1 Like

Hi,
i have the same issue, following the quick start guide. (stuck on Installing dependencies after UnhandledPromiseRejectionWarning)
I tried with:
node v13.9.0
npm 6.13.7
yarn 1.22.0
webiny 3.2.1
I tried downgrading yarn until 1.18 step by step without success.
Tried with node v10.16.3 version without success
Any clue?

Hey @Thesee, I have no idea why this is happening, but I will test it using the package versions you provided and get back to you. Thanks for reporting :slight_smile:

Btw. is it Windows, Mac, Linux? Just wondering… I work mainly on Windows, but can test on both Windows and Mac, so please let me know what’s your OS.

Hi @pavel,
i’m working on Linux Fedora Server release 29. Kernel: 5.3.11-100.fc29.x86_64
Let me know if you need more information. I can switch to a Ubuntu or another Fedora release, I use mainly Linux to develop.
Thank you.

@Thesee I’m setting up Fedora Workstation 31 as a virtual machine to give it a go.
However, EPERM error is not something Webiny throws. It has to do something with permissions during execution of yarn itself.

The project creation goes like this:

  • we create the basic files/folder structure
  • run yarn to setup the monorepo and install dependencies

EPERM is thrown by yarn at this point. I wonder what causes the error. There are hundreds of issues about that particular error all around Github, so it’s hard to tell for sure.

I’ll let you know how my test goes on Fedora 31.

Ok, so I finally managed to setup a virtual machine, and try Webiny on Fedora 31. Node v13.9.0 and yarn 1.21.1; everything worked as expected.

Maybe you could try it on another system?

wow,
yes absolutely I will try a different OS.
Thanks for your time, i’ll post a confirm about it, maybe it can be useful for other people.

Regards

Hi
probably there is something wrong with the Fedora server release: upgraded to 30, then to 31
same problem.
Using a random forgotten and dusty VM :laughing: with a Fedora workstation release 30 it works like a charm.
So i think in the end that the problem is related only to the server release of Fedora.

Happy coding.

Great, good to know. Let us know if you run into a similar issue on any other linux distro and I’ll be happy to debug :rocket: