我的angular-cli项目安装了节点模块,工作正常。当我将项目拉到新目录时,我可以使用以下警告进行npm安装:
npm WARN deprecated angular-cli@1.0.0-beta.26: angular-cli has been renamed to @angular/cli. Please update your dependencies.
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 minimatch@0.2.14: 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 v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global marked@0.3.6 should be installed with -g
npm WARN prefer global live-server@1.2.0 should be installed with -g
npm WARN prefer global node-gyp@3.5.0 should be installed with -g
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.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN @angular/compiler-cli@2.4.9 requires a peer of @angular/compiler@2.4.9 but none was installed.
npm WARN @angular/compiler-cli@2.4.9 requires a peer of @angular/core@2.4.9 but none was installed.
我正在使用棱角2.4.4。为什么在警告中提到2.4.9?我担心没有安装某些依赖项。这就是为什么我的应用程序在ng服务上无法正常工作的原因。我不想将angular-cli更新为RC1,因为它可能有更多的依赖问题。我该怎么办?
系统上的当前版本:
angular-cli: 1.0.0-beta.26
node: 6.9.4
os: win32 x64
@angular/common: 2.4.4
@angular/compiler: 2.4.4
@angular/core: 2.4.4
@angular/forms: 2.4.4
@angular/http: 2.4.4
@angular/platform-browser: 2.4.4
@angular/platform-browser-dynamic: 2.4.4
@angular/router: 3.4.4
@angular/upgrade: 2.4.4
答案 0 :(得分:1)
可能npm正在尝试使用最新的可用版本,因为packages.json的依赖关系写得像"@angular/common": "^2.4.0"
,如果你像这样使用set version strict "@angular/common": "2.4.0"
一切都应该没问题。
答案 1 :(得分:1)
更新到RC将使开发过程中的生活更轻松。由于临时从CLI中删除了ng-update
和ng-init
,因此您可能需要手动更新它。但是,值得花时间。
我认为该问题与版本有关。更新包将解决问题。
此外,如果您查看控制台,警告建议您在全局安装一些软件包。此外,考虑到升级可能会有一些突破性的变化,这需要花费一些时间,但并不多。 由于版本是beta.26,所以不会花费太多时间。
否则,现在关注Michael M的回答可能会暂时解决问题。