You seem to not be depending on “@angular/core”. T

2019-01-30 20:33发布

I want to create an angular 2 App with angular cli

I have written in the cmd:

npm install angular-cli -g

then:

ng firstngapp

but it show me an error when I write npm start ! the error image

Files image

I don't understand the problem

27条回答
孤傲高冷的网名
2楼-- · 2019-01-30 21:21

I don't know if it is still an issue. I was experiencing the same nuisance with @angular/cli v1.1.2 on npm 4.1.2. I deleted the node_modules directory and then went on to updating npm (since this was a common cause in the past).

I wanted to upgrade npm to 5.0.3 (latest) but since I was using nvm it seems to have messed up the libraries. Thus, I reinstalled node.

Then, I went with

  • npm cache clean
  • npm rebuild
  • npm install - This one several times, since every time it threw an error with a different package

In the end, every package was fine.

Hope this helps.

查看更多
混吃等死
3楼-- · 2019-01-30 21:22

from terminal

 > cd myProjectPath
 myProjectPath > npm install
查看更多
戒情不戒烟
4楼-- · 2019-01-30 21:24

Run the npm update after installing all peer dependencies and it will work.

查看更多
登录 后发表回答