package.json失败,出现错误Windows_NT 6.2.9200蔚蓝

我正在尝试在azure上部署angular2网站。 我的package.json中的postinstall命令在Azure上部署时会抛出错误。 任何人都可以请build议可能导致这个错误? PFB快照:我的postinstall命令如下所示:

"postinstall": "typings install && tsc" 

如果我不写“&& tsc”,那么ts文件不会被编译为js,但部署是干净的。

logging部署错误:

 Command: "D:\home\site\deployments\tools\deploy.cmd" Handling node.js deployment. KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot' Copying file: 'npm-debug.log' Copying file: 'package.json' Invalid start-up command "tsc && concurrently "tsc -w" "lite-server" " in package.json. Please use the format "node <script relative path>". Looking for app.js/server.js under site root. Missing server.js/app.js files, web.config is not generated Node.js versions available on the platform are: 0.6.20, 0.8.2, 0.8.19, 0.8.26, 0.8.27, 0.8.28, 0.10.5, 0.10.18, 0.10.21, 0.10.24, 0.10.26, 0.10.28, 0.10.29, 0.10.31, 0.10.32, 0.10.40, 0.12.0, 0.12.2, 0.12.3, 0.12.6, 4.0.0, 4.1.0, 4.1.2, 4.2.1, 4.2.2, 4.2.3, 4.2.4, 4.3.0, 4.3.2, 4.4.0, 4.4.1, 4.4.6, 4.4.7, 4.5.0, 4.6.0, 4.6.1, 5.0.0, 5.1.1, 5.3.0, 5.4.0, 5.5.0, 5.6.0, 5.7.0, 5.7.1, 5.8.0, 5.9.1, 6.0.0, 6.1.0, 6.2.2, 6.3.0, 6.5.0, 6.6.0, 6.7.0, 6.9.0, 6.9.1, 7.0.0. Selected node.js version 6.1.0. Use package.json file to choose a different version. Selected npm version 3.8.6 Updating iisnode.yml at D:\home\site\wwwroot\iisnode.yml > angular-quickstart@1.0.0 postinstall D:\home\site\wwwroot > typings install && tsc typings WARN deprecated 9/14/2016: "registry:dt/selenium-webdriver#2.44.0+20160317120654" is deprecated (updated, replaced or removed) typings WARN deprecated 9/14/2016: "registry:dt/core-js#0.0.0+20160725163759" is deprecated (updated, replaced or removed) typings WARN deprecated 9/14/2016: "registry:dt/angular-protractor#1.5.0+20160425143459" is deprecated (updated, replaced or removed) typings WARN deprecated 10/19/2016: "registry:dt/node#6.0.0+20160831021119" is deprecated (updated, replaced or removed) typings WARN deprecated 10/3/2016: "registry:dt/jasmine#2.2.0+20160621224255" is deprecated (updated, replaced or removed)  [?25h +-- angular-protractor (global) +-- core-js (global) +-- jasmine (global) +-- node (global) `-- selenium-webdriver (global) npm WARN optional Skipping failed optional dependency /chokidar/fsevents: npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14 npm WARN angular-quickstart@1.0.0 No license field. npm ERR! Windows_NT 6.2.9200 npm ERR! argv "D:\\Program Files (x86)\\nodejs\\6.1.0\\node.exe" "D:\\Program Files (x86)\\npm\\3.8.6\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production" npm ERR! node v6.1.0 npm ERR! npm v3.8.6 npm ERR! code ELIFECYCLE npm ERR! angular-quickstart@1.0.0 postinstall: `typings install && tsc` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the angular-quickstart@1.0.0 postinstall script 'typings install && tsc'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular-quickstart package, npm ERR! not with npm itself. Failed exitCode=1, command="D:\Program Files (x86)\nodejs\6.1.0\node.exe" "D:\Program Files (x86)\npm\3.8.6\node_modules\npm\bin\npm-cli.js" install --production npm ERR! Tell the author that this fails on your system: An error has occurred during web site deployment. npm ERR! typings install && tsc npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular-quickstart npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls angular-quickstart npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! D:\home\site\wwwroot\npm-debug.log Invalid start-up command "tsc && concurrently "tsc -w" "lite-server" " in package.json. Please use the format "node <script relative path>".\r\nMissing server.js/app.js files, web.config is not generated\r\ntypings WARN deprecated 9/14/2016: "registry:dt/selenium-webdriver#2.44.0+20160317120654" is deprecated (updated, replaced or removed)\r\ntypings WARN deprecated 9/14/2016: "registry:dt/core-js#0.0.0+20160725163759" is deprecated (updated, replaced or removed)\r\ntypings WARN deprecated 9/14/2016: "registry:dt/angular-protractor#1.5.0+20160425143459" is deprecated (updated, replaced or removed)\r\ntypings WARN deprecated 10/19/2016: "registry:dt/node#6.0.0+20160831021119" is deprecated (updated, replaced or removed)\r\ntypings WARN deprecated 10/3/2016: "registry:dt/jasmine#2.2.0+20160621224255" is deprecated (updated, replaced or removed)\r\n\r\nnpm WARN optional Skipping failed optional dependency /chokidar/fsevents:\r\nnpm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14\r\nnpm WARN angular-quickstart@1.0.0 No license field.\r\nnpm ERR! Windows_NT 6.2.9200\r\nnpm ERR! argv "D:\\Program Files (x86)\\nodejs\\6.1.0\\node.exe" "D:\\Program Files (x86)\\npm\\3.8.6\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"\r\nnpm ERR! node v6.1.0\r\nnpm ERR! npm v3.8.6\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! angular-quickstart@1.0.0 postinstall: `typings install && tsc`\r\nnpm ERR! Exit status 2\r\nnpm ERR! \r\nnpm ERR! Failed at the angular-quickstart@1.0.0 postinstall script 'typings install && tsc'.\r\nnpm ERR! Make sure you have the latest version of node.js and npm installed.\r\nnpm ERR! If you do, this is most likely a problem with the angular-quickstart package,\r\nnpm ERR! not with npm itself.\r\nnpm ERR! Tell the author that this fails on your system:\r\nnpm ERR! typings install && tsc\r\nnpm ERR! You can get information on how to open an issue for this project with:\r\nnpm ERR! npm bugs angular-quickstart\r\nnpm ERR! Or if that isn't available, you can get their info via:\r\nnpm ERR! npm owner ls angular-quickstart\r\nnpm ERR! There is likely additional logging output above.\r\n\r\nnpm ERR! Please include the following file with any support request:\r\nnpm ERR! D:\home\site\wwwroot\npm-debug.log\r\nD:\Program Files (x86)\SiteExtensions\Kudu\58.51026.2494\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd" 

我也尝试npmcaching清理,但它没有工作。

这是我的package.json:

 { "name": "angular-quickstart", "version": "1.0.0", "engines": { "node": "6.1.0", "npm": "3.8.6" }, "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 && tsc", "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", "ng2-bootstrap": "^1.1.14", "moment": "^2.15.2", "firebase": "3.3.0", "angularfire2": "^2.0.0-beta.5", "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": {} } 

根据https://github.com/angular/angularfire2/blob/master/package.json#L42上的angularfire2的相对依赖关系,似乎firebase版本需要&#x4E3A;3.3.0 ,我试图修改firebase版本到你的package.json文件中的3.3.0 ,它在我身边很好地工作。 请尝试按照我的步骤来解决问题。

  1. 转到应用服务编辑器(预览):

    转到门户网站,select你的应用程序服务,点击应用程序服务编辑器(预览),然后去。 在这里输入图像说明

  2. 删除node_modules文件夹:右键单击WWWROOT下的node_modules,然后将其删除。 在这里输入图像说明

  3. 编辑package.json :使用"firebase": "3.3.0"而不是"firebase": "^3.5.2"在这里输入图像说明

  4. 运行npm install:打开控制台,然后运行以下命令: npm install –production 在这里输入图像说明

通过上面的步骤,您将得到正确安装的所有依赖关系: 在这里输入图像说明

任何进一步的关注,请随时让我知道。