Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing issue while creating solana-dapp #100

Open
ap211unitech opened this issue Jan 10, 2025 · 15 comments
Open

Facing issue while creating solana-dapp #100

ap211unitech opened this issue Jan 10, 2025 · 15 comments
Assignees

Comments

@ap211unitech
Copy link

Description

Hey there! I want to initialize a solana-dapp with Next.js and Anchor but it's throwing me CreateAppError again and again. For now, I simply cloned this repo to begin with, but this issue should be addresed as soon as possible.

This issue is critical, as it's a fundamental step in setting up any Solana dApp.

image
@beeman
Copy link
Collaborator

beeman commented Jan 10, 2025

Thanks for creating the issue, just confirmed that I got the same issue locally:

image

It does seem to work well when creating a pnpm project.

image

@beeman beeman self-assigned this Jan 10, 2025
@ap211unitech
Copy link
Author

However, I got the reason why it's throwing this error. Once we install the dependencies, it just works fine.

For e.g. -

  1. Once you get CreateAppError, navigate into project with cd <project name>
  2. Do pnpm i
  3. and error is gone.

@beeman However, as you said, this works with pnpm but ideally it should be fixed for npx as well. Thank you

@beeman
Copy link
Collaborator

beeman commented Jan 10, 2025

However, I got the reason why it's throwing this error. Once we install the dependencies, it just works fine.

Yes, that was the first thing I tested. However, that doesn't get you to the desired state. For example, the script doesn't create a git repo in the new project.

It also doesn't explain why it doesn't work during the script but it does work manually.

@beeman However, as you said, this works with pnpm but ideally it should be fixed for npx as well. Thank you

I fully agree, it should work with all package managers we officially support (currently npm, yarn, and pnpm). Thanks to this issue I found that it also doesn't work well with yarn so I'm going to be fixing both issues.

@ap211unitech
Copy link
Author

Thanks 🙂

@beeman
Copy link
Collaborator

beeman commented Jan 10, 2025

Should be fixed by solana-developers/template-next-tailwind-counter#2

image

@ap211unitech if you could verify it that would be great!

@beeman
Copy link
Collaborator

beeman commented Jan 10, 2025

Also works with Yarn now!
image

@ap211unitech
Copy link
Author

@ap211unitech if you could verify it that would be great!

@beeman It still doesn't working for me for npm but works fine with yarn.

image

@beeman
Copy link
Collaborator

beeman commented Jan 11, 2025

@ap211unitech if you could verify it that would be great!

@beeman It still doesn't working for me for npm but works fine with yarn.

image

Ok, could you share the os you're on and you node and npm versions, please?

@ap211unitech
Copy link
Author

Ok, could you share the os you're on and you node and npm versions, please?

I am using MacBook M1 Pro.
Node - v20.11.1
NPM - v10.2.4

@ap211unitech
Copy link
Author

@beeman By the way, it just worked when I upgraded the Node and NPM version to latest which are v22.13.0 & v11.0.0 respectively.

@beeman beeman closed this as completed Jan 30, 2025
@mindcarver
Copy link

Regardless of - v20.11.1
NPM - v10.2.4, Both v22.13.0 and v11.0.0 still have a CreateAppError, which has not been resolved. Why is it closed

@beeman
Copy link
Collaborator

beeman commented Feb 6, 2025

Regardless of - v20.11.1 NPM - v10.2.4, Both v22.13.0 and v11.0.0 still have a CreateAppError, which has not been resolved. Why is it closed

Mainly because I didn't find a way to reproduce the issue and OP confirmed they got it working.

I will take another look though.

@beeman beeman reopened this Feb 6, 2025
@Nelocage
Copy link

Nelocage commented Feb 9, 2025

I had the same problem and my solution was as follows:

cd <project-name>
npm i

The output is probably as follows
Image
then execute the node command chown

Maybe this is not the right solution, but it solved my problem

@beeman
Copy link
Collaborator

beeman commented Feb 10, 2025

Regardless of - v20.11.1 NPM - v10.2.4, Both v22.13.0 and v11.0.0 still have a CreateAppError, which has not been resolved. Why is it closed

I just published a new version under the next tag that adds a verbose option, this might help me debug the issue.

You can use this new verbose mode by running npx create-solana-dapp@next --verbose

If you can paste the full output here I'll check if I can see where it breaks.

@beeman
Copy link
Collaborator

beeman commented Feb 10, 2025

I had the same problem and my solution was as follows:

cd
npm i
The output is probably as follows Image then execute the node command chown

Maybe this is not the right solution, but it solved my problem

From looking at the output, this has to do with the permissions on the .npm directory in your home dir. To fix this, follow the suggested command in the output (the 'permanent' fix) and be sure to not run npm install with sudo again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants