gpt4 book ai didi

javascript - Codeship 中的 Angular 代码然后是 Heroku

转载 作者:行者123 更新时间:2023-11-30 15:15:50 25 4
gpt4 key购买 nike

我想将一个基本的 Angular 代码发布到 Codeship,然后发布到 heroku。但是我有一个我无法解决的问题。我得到了 this error .我搜索了一下,发现那个node版本太旧了,但是我电脑里的node版本是最新的6.11.0,npm 3.10.10。

    {
"name": "anonymous",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "http-server dist -p $PORT",
"build": "ng build",
"test": "ng test --single-run",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ng build --aot -prod"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/cli": "1.1.1",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"http-server": "^0.10.0",
"node-wget": "^0.4.2",
"rxjs": "^5.1.0",
"wget": "0.0.1",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/language-service": "^4.2.1",
"@types/jasmine": "2.5.45",
"@types/node": "~6.0.60",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.0.4",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}
}

我不知道在 Angular 项目中在哪里设置 Node 版本。

最佳答案

您看到此错误是因为您的 Codeship 构建服务器使用的 Node 版本太旧。根据你的error message它当前使用的版本是 v0.10.48

作为 CodeShip 部署的一部分,您需要更新 Node 版本。

假设您使用的是自定义脚本,您需要添加以下行。

#Update node to version 6.11.0
nvm install 6.11.0

请注意,您需要 Node 4.1 或更高版本才能使用 Angular CLI。

关于javascript - Codeship 中的 Angular 代码然后是 Heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44476937/

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