Reputation: 10964
I am trying to deploy angular2 website on azure. postinstall command in my package.json throws error while deploying on azure. Could anyone please suggest what could be causing this error? PFB the snapshot: My postinstall command looks like:
"postinstall": "typings install && tsc"
If I dont write "&& tsc" in this then the ts files are not getting compiled to js but the deployment is clean.
LOG for deployment error:
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
> [email protected] 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: [email protected]
npm WARN [email protected] 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! [email protected] postinstall: `typings install && tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] 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: [email protected]\r\nnpm WARN [email protected] 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! [email protected] postinstall: `typings install && tsc`\r\nnpm ERR! Exit status 2\r\nnpm ERR! \r\nnpm ERR! Failed at the [email protected] 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"
I tried npm cache clean also but it did not work.
Here is my 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": {}
}
Upvotes: 1
Views: 1949
Reputation: 13918
According to the relative dependencies of angularfire2 at https://github.com/angular/angularfire2/blob/master/package.json#L42, it seems that the firebase
version needs to be 3.3.0
, I tried to modify the firebase
version to 3.3.0
in your package.json
file, and it worked fine on my side. Please try to follow my steps to fix the issue.
Go to App Service Editor (Preview):
Go to Portal, select your App Service, click on App Service Editor (Preview), then Go.
Delete node_modules folder:
Right click node_modules under WWWROOT then delete it.
Edit package.json
:
Use "firebase": "3.3.0"
instead of "firebase": "^3.5.2"
.
Run npm install:
Open console then run the following command: npm install –production
By the steps above, you’ll get all dependencies installed properly:
Any further concern, please feel free to let me know.
Upvotes: 1