I just want to install npm packages for angular on StackBlitz. How can I do that since there is no terminal on StackBlitz?
Asked
Active
Viewed 1.8k times
29
-
1Check out their docs. Basically just add the package and stackblitz should prompt you to install it if it's not already. At least, that's how they have the angular template setup: https://stackblitz.com/docs – mwilson Mar 24 '20 at 23:05
-
1@mwilson can you elaborate on what you mean by "add the package"? should I add it to `package.json` or just import it in `app.moudle.ts` or what you mean exactly? – x7R5fQ Mar 24 '20 at 23:10
-
@JasonWhite oh ok I see – x7R5fQ Mar 24 '20 at 23:11
1 Answers
51
Under the "Files" tree is a "Dependencies" section. You can add your dependencies there. If you just want the latest version you can just use the package name (ex: ngx-bootstrap
) or you can target a specific version (ex: ngx-bootstrap@5.3.0
).
Update 9/5/2022 NextJS
It looks like dependencies are not auto installed for NextJS projects. You do have access to a terminal under the code editor though. If you set focus to this terminal you can Ctrl+C to stop the dev server. You then can install you dependencies from this terminal.
npm install --save <package-name>
Then just restart the dev server with...
npx next dev
.
Hopefully this helps for NextJS users.

Jason White
- 5,495
- 1
- 21
- 30
-
7
-
-
2
-
@FrankFang It looks like some project types don't have the dependencies panel now. React and Angular still do. If there isn't you'll just have to modify the package.json file manually. – Jason White Jun 27 '22 at 18:10
-
2Next JS React stackblitz doesnt have a dependencies and just adding to package.json does not install the module. This seriously affects Stackblitz useability compared to Codesandbox – Laurence Fass Sep 05 '22 at 11:19
-
1@LaurenceFass I just spun up a NextJS quickly. Didn't fully test this because I don't know much about NextJS, but there is a terminal at the bottom that you have access to. If you focus this and Ctrl+C you have access to that terminal. You then can modify the `package.json` and in the terminal do `npm install && npx next dev`. Again didn't fully test this, just something you can try. You could also use this terminal to install dependencies with npm, `npm install --save
`. – Jason White Sep 05 '22 at 13:29