0

So I did this tutorial,(The basic Azure Cosmos DB (MongoDB) with Node.js)

https://learn.microsoft.com/en-us/azure/app-service-web/app-service-web-tutorial-nodejs-mongodb-app

I didn't changed anything in the code just what tutorial says and after git push azure master I get gulp failed(link to image)

Does anyone have any clues from what comes this error?

Edit: deploy.sh Gulp part

if [ -e "$DEPLOYMENT_TARGET/gulpfile.js" ]; then
  cd "$DEPLOYMENT_TARGET"
    eval ./node_modules/.bin/gulp imagemin
   eval ./node_modules/.bin/gulp prod    <----I added this line and still fails
  exitWithMessageOnError "gulp failed"
  cd - > /dev/null
fi

package.json only Gulp part

{
  "name": "meanjs",
  "description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.",
  "version": "0.5.0",
  "meanjs-version": "0.5.0",
  "private": false,
  "author": "https://github.com/meanjs/mean/graphs/contributors",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/meanjs/mean.git"
  },
  "engines": {
    "node": "6.9.1",
    "npm": "3.10.8"
  },
  "scripts": {
    "update": "npm update && npm prune && npm run bower",
    "clean": "rm -rf node_modules/ public/lib/",
    "reinstall": "npm cache clean && npm run clean && npm install",
    "start": "gulp",
    "start:prod": "gulp prod",
    "start:debug": "node-debug --web-host 0.0.0.0 server.js & gulp debug",
    "gulp": "gulp",
    "bower": "bower install --allow-root && bower prune --allow-root",
    "lint": "gulp lint",
    "test": "gulp test",
    "test:server": "gulp test:server",
    "test:server:watch": "gulp test:server:watch",
    "test:client": "gulp test:client",
    "test:e2e": "gulp test:e2e",
    "test:coverage": "gulp test:coverage",
    "postinstall": "npm run bower",
    "generate-ssl-certs": "scripts/generate-ssl-certs.sh"
  },
  "dependencies": {

    "passport-google-oauth": "~1.0.0",
    "passport-linkedin": "~1.0.0",
    "passport-local": "~1.0.0",
    "passport-paypal-openidconnect": "~0.1.1",
    "passport-twitter": "~1.0.4",
    "serve-favicon": "~2.4.2",
    "socket.io": "^2.0.2",
    "validator": "~7.0.0",
    "winston": "^2.3.1",
    "wiredep": "~4.0.0"
  },
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-angular-templatecache": "~2.0.0",
    "gulp-autoprefixer": "~3.1.0",
    "gulp-concat": "~2.6.0",
    "gulp-csslint": "~1.0.0",
    "gulp-csso": "~3.0.0",
    "gulp-eslint": "~3.0.1",
    "gulp-imagemin": "~3.2.0",
    "gulp-istanbul": "~1.1.1",
    "gulp-less": "~3.3.0",
    "gulp-load-plugins": "~1.5.0",
    "gulp-mocha": "~3.0.1",
    "gulp-ng-annotate": "~2.0.0",
    "gulp-nodemon": "~2.2.1",
    "gulp-protractor": "^4.0.0",
    "gulp-refresh": "~1.1.0",
    "gulp-rename": "~1.2.2",
    "gulp-rev": "^7.1.2",
    "gulp-sass": "~3.1.0",
    "gulp-uglify": "~2.1.2",
    "gulp-util": "~3.0.7",
  }
}

I also get this error on the begin of the push logs

remote: glob error { Error: ENOTSUP: operation not supported on socket, scandir 'D:\home\site\wwwroot\node_modules\phant
omjs-prebuilt\node_modules\request\node_modules\http-signature\node_modules\sshpk\bin\sshpk-conv'
remote:     at Error (native)

Edit2: The error changed a bit

remote: An error has occurred during web site deployment.
remote:     throw err;
remote: gulp failed
remote:           ^
remote: Error: Cannot find module 'readable-stream/transform'
King Tsunamy
  • 47
  • 1
  • 7
  • Welcome to StackOverflow. You may have noticed when posting your question that you would have been told you lack the reputation to post images within it. The reason for this cap is "We really do not want you to post images", and we hope you learn that lesson by the time your reputation increases to allow posting them. The reason we do not want them is because "your error output is from a terminal and in **text**". Just like the code you write is in "text" and just like the question is worded in "text. Please post errors and code as "text" **only**. No screenshots please. – Neil Lunn Jul 22 '17 at 05:57
  • That said. The specific errors in your screenshot seem to indicate that you actually missed the `npm install` step completely. I would suggest following your tutorial from the beginning again, and probably best with a clean directory to start in. Follow **all** the instructions this time. – Neil Lunn Jul 22 '17 at 05:59
  • npm install was executed, I get this error from the server part where Azure executes npm install ,not me – King Tsunamy Jul 22 '17 at 06:01
  • Also you clearly did not [install gulp](https://nodejs.org/). There is a list of prerequisites on that page. Stop and start again and actually follow all the instructions. – Neil Lunn Jul 22 '17 at 06:02
  • If the server runs locally means that I didn't installed gulp ? I installed it and get updated 1 package in 51.731s so it was there – King Tsunamy Jul 22 '17 at 06:04

1 Answers1

0

You did install gulp. Make sure you have installed gulp-cli.
And, as mentioned in "no command 'gulp' found - after installation"

Also, node_modules/.bin/ isn't in your %PATH%.
But it is automatically added by npm when running npm scripts (see this blog post for reference).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I installed it, the part with PATH I don't understand,I don't know how Azure server has the path set – King Tsunamy Jul 22 '17 at 07:25
  • @KingTsunamy you can modify deploy.sh in order for the script to display its PATH: that will give a clue – VonC Jul 22 '17 at 07:26
  • It seems that .bin part is added ,I edited my post with gulp part from deploy.sh – King Tsunamy Jul 22 '17 at 17:48
  • @KingTsunamy What the package.json includes? Also https://github.com/gulpjs/gulp/issues/1128#issuecomment-117856541 – VonC Jul 22 '17 at 17:56
  • @KingTsunamy gulp 3, I see: https://github.com/meanjs/mean/blob/master/package.json#L82 – VonC Jul 22 '17 at 17:58
  • @KingTsunamy Any luck deleting `~/.nmp` and `node_modules` to see if `gulp` in then shows up in `./node_modules/.bin/`? – VonC Jul 22 '17 at 18:04
  • Yes I tried,same error but twice because I added another line in deploy.sh – King Tsunamy Jul 22 '17 at 18:15
  • I updated the post,I just saw an error at begin,maybe that affect the result of the gulp installation – King Tsunamy Jul 22 '17 at 18:43
  • Strange indeed. https://github.com/Azure/azure-storage-node/issues/142#issuecomment-206185448 – VonC Jul 22 '17 at 18:45
  • @KingTsunamy Also, same case here: https://github.com/projectkudu/kudu/issues/2299#issuecomment-307927280 – VonC Jul 22 '17 at 18:47
  • @KingTsunamy Would https://stackoverflow.com/a/35153955/6309 help? (even though this is Azure, not a local Windows installation) – VonC Jul 22 '17 at 18:47
  • No,those made me think maybe the NOD_ENV variable is not set,I set it in the source file but the error doesn't dissapear – King Tsunamy Jul 22 '17 at 19:02
  • Now I see at begin Invalid start-up command "gulp" in package.json. Please use the format "node – King Tsunamy Jul 22 '17 at 19:03
  • @KingTsunamy you mean as setting NODE_ENV to production? (https://github.com/meanjs/mean/blob/e596375b62e65dfac7cf4154aa20c7cfd3207c75/modules/core/tests/server/core.server.config.tests.js#L99) – VonC Jul 22 '17 at 19:05
  • Yes,it must be production – King Tsunamy Jul 22 '17 at 19:08
  • I added the new error,I uploaded with kudu console the node_modules folder and got that error – King Tsunamy Jul 23 '17 at 10:08
  • @KingTsunamy And again, deleting node_modules would not help? (https://stackoverflow.com/a/33749751/6309) (https://github.com/rvagg/through2/issues/39#issuecomment-114261710) – VonC Jul 23 '17 at 10:11
  • tried now I get bower error,seems that is from Azure server the error,I tried second time the server stopped because I used too much of the CPU – King Tsunamy Jul 23 '17 at 10:55