无法将 angular cli 降级到 1.0.0-Beta.24

Unable to downgrade angular cli to 1.0.0-Beta.24

我是 angular 的新手,我想 运行 一个使用 angular- cli 版本 1.0.0-beta.24 的 angular 项目。

我尝试卸载当前的 npm 版本,清理缓存,然后 npm install -g angular-cli@1.0.0-beta.24。但它不起作用。我正在使用节点版本 0.35.1

我已经安装了 node -v v6.0.0,但 nvm 不工作

Usually when you are downgrading/upgrading Angular projects you have to make sure that Angular CLI version matches Angular version and Typescript version. More details

在您的情况下,如果您要降级到 1.0.0-beta.24,则必须使用 NodeJS v6.x 并确保您使用的是 Typescript v2.0.x

此外,在降级版本时,请确保删除 node_modules 文件夹和 package-lock.jsonyarn.lock 文件(如果项目中有)。然后运行npm i或者yarn拉取旧包

If you are having issues switching NodeJS versions try NVM

更新:
您收到的错误可能与连接问题有关。如果您使用代理,请尝试:

npm config set proxy http://your.company.proxy.com:port
npm config set https-proxy http://your.compny.company.com:port