1

I install AngularJs using the command npm install -g angular-cli and afterwards, when I was trying to create new project, I get the following error,

Cannot find module 'reflect-metadata'

What should I for resolve the error ?

1
  • 1
    Make sure you are using npm v3. Have you tried npm install -g reflect-metadata? Also take a look at this issue: github.com/angular/angular-cli/issues/2431 Commented Oct 14, 2016 at 12:33

3 Answers 3

1

I had to reintall nodeJS from their website and install reflect-metadata and portfinder using the following commands while being as superuser,

sudo npm install -g reflect-metadata
sudo npm install -g portfinder

Afterwards, I can create new project using the command,

ng new myProject
Sign up to request clarification or add additional context in comments.

Comments

0

Upgrade npm by npm install -g npm. If problem still exists try:

npm i -g reflect-metadata

2 Comments

After running the command npm install -g npm, I get the follwoing error, -bash: npm: command not found
Try curl -L https://npmjs.org/install.sh | sudo sh it will reinstall npm
0

Re-installing node.js worked for me.

Comments

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.