node.js - 安装 Angular-cli

标签 node.js angular npm angular-cli

Angular 对我来说很新,英语不是我的母语,所以我提前道歉。 我是一名学生,我必须使用 MEAN 平台制作一个应用程序。我们在大学里从未使用过任何 MEAN 组件或 javascript,但现在我必须做这个项目。我正在关注本教程 -> https://www.youtube.com/watch?v=wtIvu085uU0&list=PLTPtZWpWLI00vlAPQnDt8OlPwoYxuMCQo&index=4视频中 45 分钟内的一切都运行良好。 45 分钟时,它说我必须安装 @angular/cli 但我第一次安装时遇到了错误。然后我尝试再次输入 npm install @angular/cli ,然后就没有错误了。一切都应该如此,就像视频中那样。但是,当我输入 ng new client 时,它说

ng 未被识别为内部或外部命令、可操作程序或批处理文件。

我不知道该怎么办,我尝试再次安装 angular-cli 几次,但每次都是一样的。我很绝望。

版本:

node --version = v6.11.3

npm --version = 3.10.10

Windows 10

当我输入“npm install @angular/cli”时出现错误:

npm ERR! tarball.destroy is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! github
npm WARN retry will retry, error on last attempt: Error: EBUSY: resource busy or locked, rename 'C:\Users\Loran\AppData\Local\Temp\npm-9616-ee3846a1\registry.npmjs.org\eventemitter3-\eventemitter3-1.2.0.tgz.1057597416' -> 'C:\Users\Loran\AppData\Local\Temp\npm-9616-ee3846a1\registry.npmjs.org\eventemitter3-\eventemitter3-1.2.0.tgz'
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "@angular/cli"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10

npm ERR! tarball.destroy is not a function
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! github
kontakti@1.0.0 D:\Project\kontakti
`-- @angular/cli@1.4.0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN kontakti@1.0.0 No description
npm WARN kontakti@1.0.0 No repository field.
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "@angular/cli"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10

npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! github

npm ERR! Please include the following file with any support request:
npm ERR! D:\Project\kontakti\npm-debug.log

最佳答案

对于这些版本:

node --version = v6.11.3

npm --version = 3.10.10

你应该尝试 Angular CLI 4

$npm install -g @angular/cli@1.4

关于node.js - 安装 Angular-cli,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46123700/

相关文章:

node.js - npm install 出现错误

node.js - Passportjs 本地策略缺少凭据错误消息

angular - 如何正确测试 $injector 的使用?

javascript - npm 安装在不在 node_modules/中的模块上

node.js - 每日特定时间自动运行功能

Node.js WriteStream 在关闭之前不会将数据写入文件

javascript - Angular 异步验证器未按预期工作

angularjs - 无法将内容类型设置为 'application/json' Angular JS 2

node.js - 安装 Nodejs v9.0.0 后如何将 npm 从 v5.4.1 升级到最新版本

javascript - Yeoman.io 在安装 generator-angular 时出现问题