Ask coding questions

← Back to all posts
How do I use npm to download and use angular2
Crewmainzz

Is there any way for me to use angular2 on repl.it? I tried getting the npm library then doing 'npm install -g @angular/cli' but it says npm is undefined. I alsotried downloading the @angular/cli library and tried doing 'ng new name' but that did not work as well.

Answered by vedprad1 [earned 5 cycles]
View Answer
Voters
vedprad1
Crewmainzz
Comments
hotnewtop
vedprad1

In the node.js project, do the following:
1. Go to the sidebar on the left side of your screen.
2. Click on the box icon called packages.
3. Search for your module.
4. Click on your module, and then click the plus sign.

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!

Crewmainzz

@vedprad1 I did that, then when I do ng new it does not work in the console even though it is an angular command

vedprad1

@Crewmainzz : I'm not entirely sure if command line is supported by repl.it. I have also had multiple problems regarding command lines, but repl.it has never fixed it. Sorry.

phillipkregg

@vedprad1 This doesn't work. Even after reloading the page or running the project, the console throws a reference error that "ng is not defined". The angular/cli is not compatible with repl.it

SkillGG

@phillipkregg have you tried npx ng new?