DEV Community

Cover image for Windows, Angular CLI, and NodeJS
bob.ts
bob.ts

Posted on • Edited on

5 1

Windows, Angular CLI, and NodeJS

I recently had the honor of working with a neighbor beginning his development journey. He is taking a course through his employer and using a work computer with Windows installed.

Initially, I saw that he was using Git Bash ... mostly unsuccessfully. In particular, the Angular CLI was failing with command not found. He apparently had figured out some creative npx commands.

I wanted something simpler for him.

Knowing he had NodeJS installed, we set the path to the Angular CLI and made a custom shortcut to the NodeJS Command Prompt.

Setting the Path

We followed the rabbit hole and found the Angular CLI in the following location ...



C:\Users\<username>\AppData\Roaming\npm\node_modules\@angular\cli


Enter fullscreen mode Exit fullscreen mode

Then, we opened the Environment Variables and added this to the Path. This ensures that we are able to reference the CLI in the command prompt later.

Windows Environment Variables

Windows Environment Variables - New

Custom Shortbut

Then, we located the NodeJS Command Prompt shortcut ...



C:\Program Files\nodejs


Enter fullscreen mode Exit fullscreen mode

We then copied the shortcut and placed it on the desktop to make things a bit easier.

The biggest change we made to the shortcut was to set the "Start In" folder to the root of his projects folder ... we got to these settings by Right-Clicking and selecting Properties.

NodeJS Command Prompt Properties

The TARGET here should be ...



C:\Windows\System32\cmd.exe /k "C:\Program Files\nodejs\nodevars.bat"

Enter fullscreen mode Exit fullscreen mode




Windows 11

The previous information works for Windows 10 and Windows 11. However, I've used the newer terminal settings to add a profile. These images have everything I think you need.

Add the prompt to the list ...

Image description

Then, set is as default ...

Image description

Conclusion

This simple setup gave him much more flexibility without any hassles for Angular development using the CLI.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (1)

Collapse
 
fashion86 profile image
Fashion86

Yeah, that's simple and very useful. Thanks

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay