简体   繁体   English

angular-cli项目上的npm install问题

[英]npm install issue on angular-cli project

I have angular-cli project with node modules installed that is working properly. 我有安装了正常工作的节点模块的angular-cli项目。 When I pulled project to new directory i am able to to do npm install with following warnings: 当我将项目拉到新目录时,我可以执行npm install并显示以下警告:

    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.

I am using angular 2.4.4.why is 2.4.9 mentioned in warnings? 我正在使用角度2.4.4。为什么在警告中提到2.4.9? I am afraid that some dependencies are not installed. 恐怕未安装某些依赖项。 And that's why my application is not working properly on ng serve. 这就是为什么我的应用无法在ng服务上正常工作的原因。 I don;t want to update angular-cli to RC1 since it may have more issues with dependencies. 我不希望将angular-cli更新为RC1,因为它可能存在更多的依赖问题。 What should I do? 我该怎么办?

current versions on system: 系统上的当前版本:

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

可能是npm试图使用最新的可用版本,因为在package.json上存在依赖关系。如果使用严格的设置版本,例如"@angular/common": "2.4.0""@angular/common": "^2.4.0"会写为"@angular/common": "^2.4.0" "@angular/common": "2.4.0"一切正常。

Updating to the RC will make the life easy while developing. 更新到RC将使开发过程中的生活变得轻松。 Since ng-update and ng-init are removed temporarily from the CLI you might have to manually update it. 由于ng-updateng-init已从CLI临时删除,因此您可能必须手动更新它。 But, it's worth the time. 但是,这是值得的。 I assume that issue is with the version. 我认为该问题与版本有关。 Updating the packages will solve the issue. 更新软件包将解决此问题。

Also, If you look at the console, the warnings are suggesting you install some packages globally. 另外,如果您查看控制台,则警告提示您全局安装某些软件包。 Also, considering about upgrading there might be breaking changes that will take a bit of time but, not much. 另外,考虑进行升级时,可能会有一些破例的更改,但需要花费一些时间,但是花费不多。 Since the version is beta.26 It won't take much time. 由于该版本为beta.26,因此不会花费太多时间。

Otherwise, for now following Michael M s answer might temporarily solve the issue. 否则,暂时按照Michael M的回答可能会暂时解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM