使用 angular/cli 设置新项目时出错 [英] Error setting up new project with angular/cli

查看:26
本文介绍了使用 angular/cli 设置新项目时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 npm 和 Angular 2 的新手,我正在尝试使用 angular/cli 设置一个新的 Angular 2 项目.

I am new to npm and Angular 2, I am trying to setup a new Angular 2 project using angular/cli.

我目前正在跑步:

节点 v8.9.3npm v5.6.0视窗 10

Node v8.9.3 npm v5.6.0 Windows 10

首先,我运行了 npm install -g @angular/cli,它似乎安装得很好.然后我去了我想开始我的项目的文件夹,运行 ng new my-app 但一直出现这个错误.

First, I ran npm install -g @angular/cli which seemed to install just fine. Then I went to the folder where I wanted to start my project, ran ng new my-app but kept getting this error.

npm WARN 已弃用 angular-cli@1.0.0-beta.22-1:angular-cli 已被弃用重命名为@angular/cli.请更新您的依赖项.

npm WARN deprecated angular-cli@1.0.0-beta.22-1: angular-cli has been renamed to @angular/cli. Please update your dependencies.

npm WARN deprecated twin-cookie@2.2.2: ReDoS 漏洞解析设置-Cookie https://nodesecurity.io/advisories/130

npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130

npm WARN deprecated node-uuid@1.4.8: 改用 uuid 模块

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead

npm WARN deprecated graceful-fs@3.0.11: 请升级到 graceful-fs4 与当前和未来版本的 Node.js 兼容

npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

npm WARN 已弃用 minimatch@0.3.0:请更新到 minimatch 3.0.2或更高以避免 RegExp DoS 问题

npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

npm WARN 已弃用 minimatch@2.0.10:请更新到 minimatch 3.0.2或更高以避免 RegExp DoS 问题

npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

npm WARN deprecated graceful-fs@1.2.3: 请升级到 graceful-fs 4与当前和未来版本的 Node.js 兼容

npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

npm WARN codelyzer@2.0.1 需要@angular/compiler@^2.3.1 的同级||>=4.0.0-beta <5.0.0 但没有安装.您必须安装对等方自己依赖.

npm WARN codelyzer@2.0.1 requires a peer of @angular/compiler@^2.3.1 || >=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN codelyzer@2.0.1 需要@angular/core@^2.3.1 ||

npm WARN codelyzer@2.0.1 requires a peer of @angular/core@^2.3.1 ||

=4.0.0-beta <5.0.0 但没有安装.您必须自己安装对等依赖项.

=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN @ngtools/webpack@1.9.0 需要 webpack@^2.2.0 的 peer ||^3.0.0 但没有安装.您必须安装对等依赖项自己.

npm WARN @ngtools/webpack@1.9.0 requires a peer of webpack@^2.2.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN extract-text-webpack-plugin@2.1.2 需要一个 peerwebpack@^2.2.0 但没有安装.您必须安装对等方自己依赖.

npm WARN extract-text-webpack-plugin@2.1.2 requires a peer of webpack@^2.2.0 but none is installed. You must install peer dependencies yourself.

npm WARN string-replace-loader@1.3.0 需要 webpack@1 的 peer ||2||3 但没有安装.您必须安装对等依赖项自己.

npm WARN string-replace-loader@1.3.0 requires a peer of webpack@1 || 2 || 3 but none is installed. You must install peer dependencies yourself.

npm WARN tslint-loader@2.1.5 需要 tslint@^3.0.0 的对等点,但没有已安装.您必须自己安装对等依赖项.

npm WARN tslint-loader@2.1.5 requires a peer of tslint@^3.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN webpack-dev-middleware@1.12.2 需要一个 peerwebpack@^1.0.0 ||^2.0.0 ||^3.0.0 但没有安装.你必须自己安装对等依赖项.

npm WARN webpack-dev-middleware@1.12.2 requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3(node_modules\fsevents):

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform forfsevents@1.1.3:想要 {"os":"darwin","arch":"any"}(当前:{"os":"win32","arch":"x64"})

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm 错误!路径 C:\Web Development\Projects\angular 2实践\my-app\node_modules\@angular-cli\ast-tools\node_modules\mkdirp\bin\cmd.js

npm ERR! path C:\Web Development\Projects\angular 2 practice\my-app\node_modules\@angular-cli\ast-tools\node_modules\mkdirp\bin\cmd.js

npm 错误!代码ENOENT

npm ERR! code ENOENT

npm 错误!错误号 -4058

npm ERR! errno -4058

npm 错误!系统调用chmod

npm ERR! syscall chmod

npm 错误!enoent ENOENT: 没有这样的文件或目录,chmod 'C:\Web开发\项目\角度 2实践\my-app\node_modules\@angular-cli\ast-tools\node_modules\mkdirp\bin\cmd.js'

npm ERR! enoent ENOENT: no such file or directory, chmod 'C:\Web Development\Projects\angular 2 practice\my-app\node_modules\@angular-cli\ast-tools\node_modules\mkdirp\bin\cmd.js'

npm 错误!enoent 这个跟npm找不到文件有关.

npm ERR! enoent This is related to npm not being able to find a file.

npm 错误!恩恩

npm 错误!可以在以下位置找到此运行的完整日志:

npm ERR! A complete log of this run can be found in:

npm 错误!C:\用户\杰森Kervin\AppData\Roaming\npm-cache_logs\2017-12-12T00_57_54_496Z-debug.log

npm ERR! C:\Users\Jason Kervin\AppData\Roaming\npm-cache_logs\2017-12-12T00_57_54_496Z-debug.log

软件包安装失败,见上文.

Package install failed, see above.

推荐答案

尝试以下步骤:

  1. npm 缓存清理 --force
  2. 打开 cmd 并转到您当前的用户 cd C:\Users{您的用户名这里}
  3. npm 配置设置注册表 http://registry.npmjs.org/
  4. npm install -g npm@latest
  5. npm install -g @angular/cli

这篇关于使用 angular/cli 设置新项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆