How do I open a terminal in Stackblitz while working on an Angular project?

Viewed 7090

I know Stackblitz offers support for generating services and components from a couple of clicks. But I still need to work on terminal for my practice and add dependencies. Please don't answer that there are other better, methods than Terminal, that is not the question.

And I know that a terminal can be opened as I just opened an angular project which had terminal opened in it, but I couldn't find it or redo it.

So, How do I open a terminal in Stackblitz while working on an Angular project?

8 Answers

In Stackblitz You do not have a terminal to run Angular CLI commands. But you can use Angular Generator to generate components, services, Pipe, Directive, etc., etc.

Angular Generator

To get a terminal, create a Node.js application on StackBlitz and use npm and the Angular CLI to create an Angular application .

StackBlitz screenshot with terminal:

It seems like you can't open a terminal in an Angular Project, but if you create a Node.js app, you can use the terminal to create an Angular project just as you would in a standard IDE e.g. VSCode.

However, I assume there is some sort of downside to this as the standard Angular setup available on the StackBlitz dashboard doesn't allow you to use the terminal. My guess is that booting a WebContainer (StackBlitz's Node.js runtime) is slower than just rendering the app statically.

Just discovered that when you get access to a terminal via NodeJS project, like Chris mentioned, and completely replace the files within it with local angular app files... you're up and running in less than a minute pretty much (after you run npm install of course)!

I did this today so I could share a private project with team members (and avoid having to set up their environments locally)!

enter image description here

Hope this helps someone else looking for similar solutions!

Actually I came in here with the exact question @user5432838 . I saw terminal when I first opened stackblitz , however couldnt find it later . I tried opening stackblitz again and I realized that the terminal is just getting hidden in the bottom. To open it Just scroll to the bottom and drag up the bottom margin. And there you go !!! There is terminal in stackblitz.enter image description here

Create a NodeJS Project then you can see the terminal. After that type these commands:

  • npm install @angular/cli
  • ng new your-app-name
  • cd your-app-name
  • ng serve --open

Your Angular project is now published on a port, you should check the browser(on the right hand side of the Stackblitz platform)

Don't type anything in that terminal after your program was published, You can click the + button the open new Terminal. Use the new terminal for the new commands.

Related