嘿,我正在尝试安装Angular Cli,但是我总是收到安装失败的包。然后我尝试启动服务器,它告诉我你似乎没有依赖于"@angular/core“。这是一个错误。

发布于 2018-04-01 23:19:31
检查您是否在终端的项目文件夹中
发布于 2018-02-19 13:41:46
首先检查节点
node -v和npm已正确安装
npm -v然后重试
npm install -g npm@latest 然后将其添加到ts文件中
const _core = require("@angular/core");发布于 2018-03-14 05:04:27
这就是我在我的机器上解决这个问题的方法。
我首先运行的是npm install @angular/core。
然后我运行了npm install --save。
当两个安装都成功完成后,我运行了npm serve,并收到一个错误消息
"Versions of @angular/compiler-cli and typescript could not be determined.
The most common reason for this is a broken npm install.
Please make sure your package.json contains both @angular/compiler-cli and typescript in
devDependencies, then delete node_modules and package-lock.json (if you have one) and
run npm install again."然后我删除了我的node_modules文件夹以及我的package-lock.json文件夹。
删除这些文件夹后,我再次运行npm install --save。
我运行npm start并收到另一个错误。这个错误是Error: Cannot find module '@angular-devkit/core'说的。
我运行了npm install @angular-devkit/core --save。
最后,我运行了npm start,项目开始了!
https://stackoverflow.com/questions/48859420
复制相似问题