package.json中使用bitbucket在Azure上部署Angular2项目时出错

我正面临在azure上部署angular2应用的问题。 我在下面的行中遇到错误

"engines":{"node":"6.2.1"}, 

我已经给出了这个版本,因为WEBSITE_NODE_DEFAULT_VERSION的值是6.2.1。 任何人有这个想法然后请分享。

这是错误快照: 在这里输入图像描述

package.json看起来如下所示:

 { "name": "angular-quickstart", "version": "1.0.0", "engines":{"node":"6.2.1"}, "description": "QuickStart package.json from the documentation, supplemented with testing support", "scripts": { "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ", "docker-build": "docker build -t ng2-quickstart .", "docker": "npm run docker-build && docker run -it --rm -p 3000:3000 -p 3001:3001 ng2-quickstart", "pree2e": "npm run webdriver:update", "e2e": "tsc && concurrently \"http-server -s\" \"protractor protractor.config.js\" --kill-others --success first", "lint": "tslint ./app/*/.ts -t verbose", "lite": "node_modules\.bin\lite-server", "postinstall": "typings install", "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"", "test-once": "tsc && karma start karma.conf.js --single-run", "tsc": "node_modules\.bin\tsc", "concurrently": "node_modules\.bin\concurrently", "tsc:w": "node_modules\.bin\tsc -w", "typings": "node_modules\.bin\typings", "webdriver:update": "webdriver-manager update" }, "keywords": [], "author": "", "licenses": [ { "type": "MIT", "url": "https://github.com/angular/angular.io/blob/master/LICENSE" } ], "dependencies": { "@angular/common": "~2.1.0", "@angular/compiler": "~2.1.0", "@angular/core": "~2.1.0", "@angular/forms": "~2.1.0", "@angular/http": "~2.1.0", "@angular/platform-browser": "~2.1.0", "@angular/platform-browser-dynamic": "~2.1.0", "@angular/router": "~3.1.0", "@angular/upgrade": "~2.1.0", "angular-in-memory-web-api": "~0.1.5", "bootstrap": "^3.3.7", "systemjs": "0.19.39", "core-js": "^2.4.1", "reflect-metadata": "^0.1.8", "rxjs": "5.0.0-beta.12", "zone.js": "^0.6.25", "concurrently": "^3.0.0", "lite-server": "^2.2.2", "typescript": "^2.0.3", "typings": "^1.4.0" }, "devDependencies": { "concurrently": "^3.0.0", "lite-server": "^2.2.2", "typescript": "^2.0.3", "typings": "^1.4.0", "canonical-path": "0.0.2", "http-server": "^0.9.0", "tslint": "^3.15.1", "lodash": "^4.16.2", "jasmine-core": "~2.5.2", "karma": "^1.3.0", "karma-chrome-launcher": "^2.0.0", "karma-cli": "^1.0.1", "karma-htmlfile-reporter": "^0.3.4", "karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "^3.3.0", "rimraf": "^2.5.4" }, "repository": {} } 

请提出解决scheme。

在服务器或云中部署应用程序时,应该在process.env.PORT提供的端口上运行它,例如:

 app.listen(process.env.PORT || 3000, () => { console.log('Example app is running!'); }); 

在您的package.json文件中,启动脚本默认将应用程序设置为在端口3000上运行。

从angular度js2纪录片:

 If Node.js and npm aren't already on your machine, install them. Our examples require node v4.xx or higher and npm 3.xx or higher. To check which version you are using, run node -v and npm -v in a terminal window. 

你能检查你的npm版本吗?