node环境升级

Update NPM

npm install npm@latest -g

Update typescript

npm -g upgrade typescript

or

npm install typescript@latest -g

查看版本

tsc --version

angular-cli更新步骤

If you’re using Angular CLI beta.28 or less, you need to uninstall the angular-cli packages:

npm uninstall -g angular-cli          # Remove global package
npm uninstall --save-dev angular-cli  # Remove from package.json

Otherwise, uninstall the @angular/cli packages:

npm uninstall -g @angular/cli         # Remove global package
npm uninstall --save-dev @angular/cli # Remove from package.json

Also purge the cache and local packages:

rm -rf node_modules dist # Use rmdir on Windows
npm cache clean

全局安装

npm install -g @angular/cli@latest

本地安装

npm install --save-dev @angular/cli@latest
npm install

如果您在删除旧Angular CLI之前意外更新了NPM,则可能会发现使用npm卸载卸载软件包是无效的。 这可能是因为全局安装(和卸载)路径在从/ usr / local / lib到/ usr / lib之间的npm版本之间改变,因此不再通过旧目录进行搜索。 在这种情况下,您必须手动删除它:

rm -rf / usr / local / lib / node_modules / @ angular / cli

如果旧的Angular CLI包仍然存在,您需要研究如何删除它,然后再继续升级。

npm cache clean

安装cnpm(https://npm.taobao.org/

npm install -g cnpm –registry=https://registry.npm.taobao.org

在项目文件夹下安装node-sass

cnpm install –save-dev node-sass

全局安装sass
cnpm install node-sass

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值