0

I'm trying to set up a new Angular project. My preference is to use the pnpm package manager for building Angular projects, and I'm on a macOS system.

I'm encountering an unexpected issue when using pnpm with the Angular CLI. My habit is to navigate to a specific folder in the terminal. When I then run the command pnpm ng new <myprojectname> from within that designated directory, the new project consistently gets created in my user's home directory instead of the current working directory. I've attempted this numerous times, but the outcome is always the same.

However, when I use npm and simply type ng new <myprojectname>, the project correctly scaffolds within the specified folder.

1 Answer 1

0

It looks like you can pass an option for the directory. It's called --dir or shorter -C. Try this instead:

pnpm --dir . ng new <myprojectname>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer, but I regret that it doesn't work, I asked AI again, I found " pnpm dlx @angular/cli new <project name> --routing --style css", this order works well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.