我想在 bluemix 上部署一个 Angular 2 应用程序。该代码位于 github,我想在推送某些内容时部署我的应用程序。所以我创建了一个管道。首先是构建管道:构建 Angular 应用程序我需要 angularCLI,所以我想安装它。不幸的是,默认节点版本是 4.2,但 cli 至少需要 6.9。这是我的构建外壳命令:
#!/bin/bash
# The default Node.js version is 0.10.40
# To use Node.js 0.12.7, uncomment the following line:
#export PATH=/opt/IBM/node-v0.12/bin:$PATH
# To use Node.js 4.2.2, uncomment the following line:
export PATH=/opt/IBM/node-v6.9/bin:$PATH
npm install -g @angular/cli
npm run build
我试图用 6.9 替换 4.2,但它不起作用,它使用默认节点版本 0.10.40。有人知道如何设置节点版本吗?此外,npm 版本已过时......我该如何解决这个问题?