node.js - Deploying Sails.js project to Google cloud: "Fatal error: Unable to find local grunt." -


i trying deploy sails.js project google cloud. after running gcloud preview app deploy app.yaml --set-default, deploy seems successful when browse project, see

error: server error

the service requested not available yet. please try again in 30 seconds.

the logs console.developers.google.com show "fatal error: unable find local grunt." should configure on google cloud have grunt available? or should configure in project allow cloud find grunt?

i have been able deploy demo projects https://cloud.google.com/nodejs/ not projects using sails.js.


update: solved

the problem sorted installing grunt , grunt-cli locally bunch of other dependencies. same issue can this:

make sure package.json file contains following dependencies:

"dependencies": { "express": "^4.12.0", "gcloud": "^0.15.0", "grunt": "^0.4.5", "grunt-cli": "^0.1.13", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-coffee": "^0.13.0", "grunt-contrib-concat": "^0.5.1", "grunt-contrib-copy": "^0.8.0", "grunt-contrib-cssmin": "^0.12.3", "grunt-contrib-jst": "^0.6.0", "grunt-contrib-less": "^1.0.1", "grunt-contrib-uglify": "^0.9.1", "grunt-contrib-watch": "^0.6.1", "grunt-gcloud": "^0.2.0", "grunt-sails-linker": "^0.10.1", "grunt-sync": "^0.2.3", "sails": "^0.11.0", "sails-disk": "^0.10.8" } 

then install dependencies before deploying:

 sudo npm install --save 

it's app expecting use grunt able launch webserver. common paradigm node.js web-apps using grunt run grunt serve start webserver (something app.js or bin/www.js). fact no webserver running on app's container reason see message do. grunt isn't accessible (hence serve command fails run) since dockerfile didn't install grunt.

make dockerfile install grunt. install grunt using npm.

in general, avoid falling traps these, should learn whole stack runs web app, if in broad outlines, identifying failures becomes easier.


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -