gpt4 book ai didi

angular-cli 本地低版本

转载 作者:太空狗 更新时间:2023-10-29 18:16:20 25 4
gpt4 key购买 nike

我在全局安装了最新版本的 angular-cli。版本如下。

C:\Users\W055013\kumar\learn\rx>ng --version
As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release,
which will only support Node 6.9 and greater. This package will be officially deprecated
shortly after.

To disable this warning use "ng set --global warnings.packageDeprecation=false".


_ _ _
__ _ _ __ __ _ _ _ | | __ _ _ __ ___ | |(_)
/ _` || '_ \ / _` || | | || | / _` || '__|_____ / __|| || |
| (_| || | | || (_| || |_| || || (_| || | |_____|| (__ | || |
\__,_||_| |_| \__, | \__,_||_| \__,_||_| \___||_||_|
|___/
angular-cli: 1.0.0-beta.28.3
node: 6.9.1
os: win32 x64

最近我开始尝试使用 ng2-ngrx-store。所以我下载了一些示例应用程序。当我尝试构建它们时,出现以下错误:

 C:\Users\W055013\kumar\learn\rx\staffer\staffer-ng2-ngrxstore>ng build
As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release,
which will only support Node 6.9 and greater. This package will be officially deprecated
shortly after.

To disable this warning use "ng set --global warnings.packageDeprecation=false".


It seems like you're using a project generated using an old version of the Angular CLI.
The latest CLI now uses webpack and has a lot of improvements including a simpler
workflow, a faster build, and smaller bundles.

To get more info, including a step-by-step guide to upgrade the CLI, follow this link:
https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.14

一种解决方案是将示例应用程序迁移到最新版本的 angular-cli。但是我不想这样做,因为我只想学习 ng2-ngrxstore。

所以,我的问题是……我可以在本地安装较低版本的 angular-cli 以便运行示例应用程序吗?如果是,怎么办?如果没有,我可以在某处获得带有新 angular-cli 版本的 ngrxstore 示例应用程序....

预先感谢您的帮助...

最佳答案

您可以使用 npm "scripts"来使用作为特定项目的开发依赖的 angular-cli 版本

当您从命令行运行“ng serve”时,它会使用您的全局包。但是,如果您将“脚本”添加到每个应用程序的“package.json”,“start”:“ng serve”并运行“npm start”,这实际上将使用本地 angular-cli(在该项目的 node_modules 文件夹中)

我相信“开始”脚本在 angular-cli 应用程序中是默认的

关于angular-cli 本地低版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42295591/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com