Deploying to heroku with grunt, bower, node modules - node.js

I am deploying a mean app to heroku and am using bower and grunt. Should I include my node modules in the git repo? If not, I'm really not sure how I need to deploy because the post script references a bower install from the node modules. Should I include my bower_components in the git repo? It doesn't seem like I should because isn't the whole point of the postscript the execute the bower install on heroku? But when I do I get an error. Here are my bower dependencies:
"dependencies": {
"angular": "1.2.x",
"angular-mocks": "~1.2.x",
"jquery": "1.10.2",
"bootstrap": "~3.1.1",
"angular-bootstrap" : "0.11.0"
}
And my package.json
{
"main": "server.js",
"engines": {
"node": "0.10.29"
},
"dependencies": {
"express": "~3.4.x",
"mongoose": "~3.6.x",
"mongodb": "^1.4.0",
"ejs": "*",
"email-templates" : "1.0.0",
"crypto": "0.0.3",
"lodash": "~2.4.1",
"aws-sdk": "2.0.0-rc11",
"passport" : "~0.1.17",
"passport-local" : "~0.1.6",
"connect-flash" : "~0.1.1",
"winston": "0.6.x",
"gm" : "1.16.0",
"apn" : "1.5.2",
"bcrypt-nodejs" : "latest",
"angular-wizard": "latest",
"point-in-polygon": "latest",
"node-mailgun": "0.0.2",
"nodemailer" : "0.7.0",
"passport-facebook" : "1.0.3"
},
"devDependencies": {
"supertest": "0.5.x",
"bower": "0.6.x",
"mocha": "1.8.x",
"should": "1.2.x",
"karma": "~0.10",
"protractor": "^0.24.2",
"http-server": "^0.6.1",
"bower": "^1.3.1",
"grunt-cli": "~0.1.13",
"grunt-env": "~0.4.1",
"grunt-node-inspector": "~0.1.3",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-csslint": "^0.2.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-cssmin": "~0.9.0",
"grunt-nodemon": "~0.2.0",
"grunt-concurrent": "~0.5.0",
"grunt-mocha-test": "~0.10.0",
"grunt-karma": "~0.8.2",
"grunt-protractor-runner": "~1.0.0",
"load-grunt-tasks": "~0.4.0",
"jasmine-reporters": "~0.4.0",
"karma": "~0.12.0",
"karma-jasmine": "~0.2.1",
"karma-coverage": "~0.2.0",
"karma-chrome-launcher": "~0.1.2",
"karma-firefox-launcher": "~0.1.3",
"karma-phantomjs-launcher": "~0.1.2",
"karma-junit-reporter": "~0.2",
"shelljs": "^0.2.6",
"xunit-file": "*"
},
"scripts": {
"postinstall": "node_modules/.bin/bower install",
"pretest": "npm install",
"test": "karma start test/karma.conf.js",
"test-single-run": "karma start test/karma.conf.js --single-run",
"preupdate-webdriver": "npm install",
"update-webdriver": "webdriver-manager update",
"preprotractor": "npm run update-webdriver",
"protractor": "protractor test/protractor-conf.js",
"update-index-async": "node -e \"require('shelljs/global'); sed('-i', /\\/\\/##NG_LOADER_START##[\\s\\S]*\\/\\/##NG_LOADER_END##/, '//##NG_LOADER_START##\\n' + cat('bower_components/angular-loader/angular-loader.min.js') + '\\n//##NG_LOADER_END##', 'app/index-async.html');\""
}
}
I get this error:
5816 info fsevents#0.2.0 Failed to exec install script
5817 error fsevents#0.2.0 install: `node-gyp rebuild`
5817 error Exit status 1
5818 error Failed at the fsevents#0.2.0 install script.
5818 error This is most likely a problem with the fsevents package,
5818 error not with npm itself.
5818 error Tell the author that this fails on your system:
5818 error node-gyp rebuild
5818 error You can get their info via:
5818 error npm owner ls fsevents
5818 error There is likely additional logging output above.
5819 error System Linux 3.8.11-ec2
5820 error command "/tmp/build_2cc32425-eae7-45af-8b95-104e1c2c7c53/vendor/node/bin/node" "/tmp/build_2cc32425-eae7-45af-8b95-104e1c2c7c53/vendor/node/bin/npm" "rebuild"
5821 error cwd /tmp/build_2cc32425-eae7-45af-8b95-104e1c2c7c53
5822 error node -v v0.10.29
5823 error npm -v 1.4.14
5824 error code ELIFECYCLE
5825 verbose exit [ 1, true ]
! Push rejected, failed to compile Node.js app
I have read that i need to npm install -g karma but that does not help. Or an error with the bower install... Are my dev dependencies incorrect?

I found this video tutorial from Joe Eames to be quite useful for developing with the MEAN stack and deploying to Heroku: http://pluralsight.com/training/courses/TableOfContents?courseName=building-angularjs-nodejs-apps-mean&highlight=
The guidance given is that you shouldn't include your node_modules in the git repo you should let Heroku build those for you when you deploy.
Reading through your files it seems that you perhaps have too many dependencies listed. i.e I don't think you need 'Bower' listed as a dev-dependency in package.json. Equally, the script you've included in your package.json is not something I've really seen before. I would deploy using either Heroku commands or the grunt build pack found here: github.com/mbuchetics/heroku-buildpack-nodejs-grunt.git
More description on how to deploy to Heroku using grunt can be found here: https://medium.com/#3runjo/how-to-deploy-a-grunt-project-on-heroku-c227cb1ddc56
I realise this isn't a full answer, but should give you enough leads to de-bug your problem.

You are missing a nodejs buildpack for heroku. Also if you are using grunt as I see you need to go for a grunt nodejs buildpack. This is the one:
https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt
You just need to register in your Gruntfile.js the tasks for building in heroku like this for example:
grunt.registerTask('heroku:development', 'clean less mincss');
grunt.registerTask('heroku:production', 'clean less mincss uglify');
Also remember to add the config variable to heroku app:
heroku config:add BUILDPACK_URL=https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt.git
You are using a really old version of bower in the package.json, mine is:
"scripts": {
"postinstall": "./node_modules/bower/bin/bower install"
},
"dependencies": {
"bower": "^1.3.5",

Add this to your .slugignore file:
/node_modules/grunt-karma/
/node_modules/grunt-protractor-runner/
/node_modules/karma/
/node_modules/karma-chrome-launcher/
/node_modules/karma-mocha/
/node_modules/karma-ng-html2js-preprocessor/
/node_modules/ngmin/
/node_modules/protractor/
/node_modules/rfile/
/node_modules/rfileify/
/node_modules/rhtml/
This solved my issue with the fsevents#0.2.0 issue.

Related

Bitbucket Pipelines from Docker Image has Missing NPM Modules

Question
What is wrong with my Dockerfile or bitbucket-pipelines.yml? Why are modules missing from the bitbucket pipelines environment?
Error
When I try to npm run build my Vue2 project with webpack using Bitbucket Pipelines, I get errors regarding missing modules.
From Logs
npm run build
> people-is#1.0.0 build /opt/atlassian/pipelines/agent/build
> node build/build.js
module.js:549
throw err;
^
Error: Cannot find module 'cli-spinners'
Files
Here are the files for configuration.
Dockerfile - builds cportwine/people-is
FROM node:8.10.0
RUN npm install
RUN npm install -g firebase-tools
CMD [ "npm", "run", "build" ]
bitbucket-pipelines.yml
image:
name: cportwine/people-is
pipelines:
default:
- step:
script:
- npm run build
package.json
{
"name": "people-is",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "cportwine",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js",
"deploy": "firebase deploy --token $FIREBASE_TOKEN"
},
"dependencies": {
"rxjs": "^5.5.8",
"uuid": "^3.2.1",
"vue": "^2.5.16",
"vue-json-excel": "^0.1.9",
"vue-router": "^2.8.1",
"vue-rx": "^5.0.0",
"vuefire": "^1.4.5",
"vuetify": "^0.15.2"
},
"devDependencies": {
"autoprefixer": "^7.2.6",
"babel-core": "^6.22.1",
"babel-loader": "^7.1.4",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^2.3.2",
"connect-history-api-fallback": "^1.5.0",
"copy-webpack-plugin": "^4.5.1",
"css-loader": "^0.28.11",
"cssnano": "^3.10.0",
"eslint": "^4.19.1",
"eslint-config-standard": "^11.0.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-html": "^4.0.2",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-standard": "^3.0.1",
"eventsource-polyfill": "^0.9.6",
"express": "^4.16.3",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.11.1",
"firebase": "^4.12.0",
"firebase-tools": "^3.17.7",
"friendly-errors-webpack-plugin": "^1.1.3",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"opn": "^5.3.0",
"optimize-css-assets-webpack-plugin": "^2.0.0",
"ora": "^1.4.0",
"rimraf": "^2.6.0",
"semver": "^5.5.0",
"shelljs": "^0.7.6",
"url-loader": "^0.5.8",
"vue-loader": "^13.7.1",
"vue-style-loader": "^3.1.2",
"vue-template-compiler": "^2.5.16",
"vuex": "^2.5.0",
"webpack": "^2.6.1",
"webpack-bundle-analyzer": "^2.11.1",
"webpack-dev-middleware": "^1.12.2",
"webpack-hot-middleware": "^2.21.2",
"webpack-merge": "^4.1.2"
},
"engines": {
"node": ">=8.10.0",
"npm": ">= 5.6.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://chaddportwine#bitbucket.org/jahnelgroup/people-is.git"
},
"keywords": [],
"license": "ISC",
"homepage": "https://bitbucket.org/jahnelgroup/people-is#readme"
}
What I see
When I ls the node_modules folder in both environments, they do not match. Modules are missing from bitbucket pipelines.
local folder
people-is/node_modules
...
chalk
char-spinner
chardet
check-types
chokidar
chownr
cipher-base
circular-json
cjson
clap
class-utils
clean-css
cli-boxes
cli-cursor
cli-spinners
cli-table
cli-table2
cli-width
cliui
...
bitbucket folder
/opt/atlassian/pipelines/agent/build/node_modules
Woah, missing modules!
...
chalk
cli-cursor
co
...
What I have tried
I added a command to the bitbucket-pipelines.yml to npm install before I build.
bitbucket-pipelines.yml
image:
name: cportwine/people-is
pipelines:
default:
- step:
script:
- npm install
- npm run build
This adds some additional modules (like cli-spinners from the error) to /opt/atlassian/pipelines/agent/build/node_modules.
bitbucket folder
/opt/atlassian/pipelines/agent/build/node_modules
...
chalk
char-spinner
chardet
check-types
chokidar
chownr
cipher-base
circular-json
cjson
clap
class-utils
clean-css
cli-boxes
cli-cursor
cli-spinners
cli-table
cli-table2
cli-width
cliui
clone
clone-response
co
...
However, the build command still fails, due to a different missing module.
Error
> people-is#1.0.0 build /opt/atlassian/pipelines/agent/build
> node build/build.js
module.js:549
throw err;
^
Error: Cannot find module './_safeGet'
Solutions
I can now build the app, but I don't know why!
1 - Simplify the Dockerfile
I removed all the npm commands. Maybe the npm install commands were redundant? There was no advantage using the Docker Image to pre-install npm packages.
2 - Remove Node_Modules before install
Using the bitbucket-pipelines.yml, remove the node_modules folder, and then perform npm install -g npm and npm install and npm install -g firebase-tools.
File Changes
bitbucket-pipelines.yml (added lines)
image:
name: cportwine/people-is
pipelines:
default:
- step:
script:
- rm -r node_modules <---- remove
- npm install -g npm <---- install
- npm install <---- install
- npm install -g firebase-tools <---- install
- npm run build
Dockerfile (lines removed)
FROM node:8.10.0
<---- remove
CMD [ "npm", "run", "build" ]
Answer ?
I'm not sure why moving all the npm install stuff into the bitbucket.pipelines.yml solved my issue building the project. I thought Docker would enable me to define my environment, e.g., install a version of node/npm and firebase. And pipelines would "run" that.
If someone could explain what I am missing, I would accept that answer.
Answer
I received support from the Atlassian Team
Leave npm install -g firebase in the docker image.
Move npm install from the docker image to the
bitbucket-pipelines.yml file.
Reason
The node_modules folder was listed in .gitignore
tl;dr
My mistake - I forgot about .gitignore and how that affects the node_modules folder in source control, e.g., Bitbucket Pipelines.
I was looking at my local node_modules folder and building locally which worked.
However
The node_modules in source control, by design, is not in-sync with my local folder because it's included in the .gitignore file.
So
It was necessary for me to rm node_modules and npm install using the bitbucket-pipelines.yml. Now, BitPipes finds the modules I have installed locally.
This is sort of the point of maintaining the package.json, but I got confused.

npm ERR! Cannot read property 'pause' of undefined --Bluemix

I am trying to deploy a Sails.js app to Bluemix and we are getting the following error during the deploy stage in the toolchain on Bluemix (When the CF PUSH command is called):
npm ERR! Cannot read property 'pause' of undefined
I understand the trace goes to the npm-error.log file, however, I haven't been able to get to it as we cannot ssh in to see whats in the file as the application is in its "off" state after a bad deploy.
This same code was successfully deployed with both Cf push {app name}} and through a simple build and deploy toolchain in Bluemix just 8 days ago.
In the build stage I can run Npm install and npm update just fine. However, it seems to do this again in the deploy stage regardless and it fails. Here is some detail on this failure
NODE_ENV=production
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=true
Visit http://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring
NODE_HOME=/tmp/app/.cloudfoundry/0/node
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
Restoring cache
Loading 3 from cacheDirectories (default):
- .npm
- .cache/yarn (not cached - skipping)
- bower_components (not cached - skipping)
Installing node modules (package.json) Building dependencies
sails#0.12.13 preinstall /tmp/app/node_modules/sails
node ./lib/preinstall_npmcheck.js
Sails.js Installation: Checking npm-version successful
npm ERR! Cannot read property 'pause' of undefined
npm ERR! /tmp/app/.npm/_logs/2017-09-09T17_02_48_660Z-debug.log
**ERROR** Unable to build dependencies: exit status 1
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223
Destroying container
npm ERR! A complete log of this run can be found in:
Successfully destroyed container
Package.json file
{
"name": "myApp",
"private": true,
"version": "0.0.1",
"description": "Stuff my app does",
"keywords": [
"Cool Apps"
],
"dependencies": {
"bcryptjs": "^2.4.3",
"cacheman": "^2.2.1",
"ejs": "2.3.4",
"elasticsearch": "^13.0.0-rc2",
"find-remove": "^1.0.1",
"fs": "0.0.1-security",
"grunt": "1.0.1",
"grunt-contrib-clean": "1.0.0",
"grunt-contrib-coffee": "1.0.0",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-cssmin": "1.0.1",
"grunt-contrib-jst": "1.0.0",
"grunt-contrib-less": "1.3.0",
"grunt-contrib-uglify": "1.0.1",
"grunt-contrib-watch": "1.0.0",
"grunt-sails-linker": "~0.10.1",
"grunt-sync": "0.5.2",
"include-all": "^1.0.0",
"jsonwebtoken": "^7.3.0",
"moment": "^2.18.1",
"moment-timezone": "^0.5.13",
"passport": "^0.2.x",
"passport-http-bearer": "^1.0.1",
"passport-idaas-openidconnect": "^1.1.0",
"passport-local": "^1.0.0",
"rc": "1.0.1",
"request": "^2.81.0",
"request-promise": "^4.2.0",
"sails": "~0.12.13",
"sails-disk": "~0.10.9",
"sails-mongo": "^0.12.2",
"stream": "0.0.2",
"uuid-1345": "^0.99.6",
"validator": "^7.0.0",
"natural-sort": "^1.0.0"
},
"scripts": {
"start": "node app.js"
},
"engines": {
"node": "^8.0.x",
"npm": "^5.0.x"
},
"main": "app.js",
"author": "Scott N",
"license": ""
}
Things I've tried so far.
-change node versions
-changed npm versions
-change dependencies versions to include the ^ prefix
-removed all dependencies but Sails in the package.json file
So Sails.js and the Nodebuildpack/Bluemix aren't playing well with each other.
Any help would be appreciated.
Thank you
It happens to me just the same. and I've to roll back the prev version of npm: 5.3.0 and it's working now. (BTW: macOS)
The error only happens when I update my npm version like this:
Update available 5.3.0 → 5.4.1
Run npm i -g npm to update
The best way to handle it is to update your package.json to use engines like so
"description": "a Sails application",
"keywords": [],
"engines": {
"node": "6.10.1",
"npm": "5.3.0"
},
Got this issue while trying to push to heroku which seems to be the npm version specified by #m-t, and also specifying the versions like above makes ibm bluemix pick it up as default node engine instead of using the latest stable version.
And don't forget to always specify your node and npm versions directly, instead of adding tilde or caret, this just to be safe. check https://stackoverflow.com/a/22345808/5836034 for more about tilde and caret
you can still check #sai-vennam answer here for more info
So I rolled back the sails version in the package.json file from 0.12 to 0.11 and it deployed fine. So CF PUSH and the newest sails version are not getting along on Bluemix. This was using Node 8.0 and NPM version ^5.0.x

How to solve the following browserify error?

I'm new to using gulp and browserify. I'm trying to follow a tutorial online which uses browserify and gulp.
Following is my package.json
{
"name": "progressive",
"version": "1.0.0",
"description": "Practcing a Progressive Web App",
"scripts": {
"start": "node ./index.js"
},
"author": "Indu Pillai",
"devDependencies": {
"browserify": "^13.1.0",
"gulp": "^3.8.8",
"gulp-browserify": "^0.5.1",
"gulp-clean-css": "^2.0.13",
"gulp-concat-css": "^2.3.0",
"gulp-if": "^2.0.1",
"gulp-sourcemaps": "^2.2.0",
"gulp-uglify": "^2.0.0",
"gulp-util": "^2.2.20",
"gulp-webserver": "^0.8.8",
"jquery": "^3.1.1",
"sw-precache": "^4.2.1"
},
"dependencies": {
"handlebars": "^4.0.5"
}
}
When I run npm install, it gives me the following error:
npm WARN browserify-shim#2.0.10 requires a peer of browserify#>= 2.3.0 < 4 but none was installed.
I don't know how to solve this problem, I'm not good at npm stuff either. I didn't ask for browserify-shim in my package.json, but may be some of the packages I asked depends on it.
Thank You!
I have the same problem
and I solve it with the following:
If you use the windows you should
Download the :(Windows Binary.Zip)
Then choose the correct architecture to your computer (32 or 64),
make it active
Open Command Prompt as Administrator
Execute this on the command line: npm install -g #angular/cli

Npm install doesn't work (no errors), but npm install <package> does

noob question regarding Node and npm: I have a package.json file with a list of dependancies that I want to install with npm install. When I run the command, nothing happens, I don't even receive an error, nothing at all :(
But if I try to install a single package from the list, it works perfectly...
I haven't created the package.json myself, so I am not sure what the "proxyURL" thing does...
{
"name": "dss",
"version": "0.0.0",
"repository": {
"type": "git",
"url": "*urlofmyrepo*"
},
"dependencies": {
"bower": "^1.7.7",
"cssmin": "^0.4.3",
"gulp": "^3.9.0",
"gulp-batch": "^1.0.5",
"gulp-concat": "^2.6.0",
"gulp-if": "^2.0.0",
"gulp-jshint": "^2.0.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-strip-debug": "^1.1.0",
"gulp-uglify": "^1.5.1",
"gulp-util": "^3.0.7",
"gulp-watch": "^4.3.5",
"jshint": "^2.9.1",
"lodash": "^4.2.1",
"minimatch": "^3.0.0",
"sass": "^0.5.0",
"uglifyjs": "^2.4.10",
"underscore": "^1.8.3",
"yuglify": "^0.1.4"
},
"private": true,
"APIMethod": "stub",
"proxyURL": "http://localhost:8000",
"devDependencies": {}
}
Any clue?
Thank you
Rename/remove your package.json file.
Create a new package file by running:
npm init
Option A: Copy the dependencies you need into the newly created package.json.
Option B: Install the packages and use --save to add the packages to the package.json file.
Run npm install to install the dependencies.
just ran into this.
in my case the answer was environment variable NODE_ENV was set to 'production'
I haven't looked it up but when I changed it to something else, it started working.
I was testing this environment variable for something else and didn't realize it had this effect also.
For me it was a bad version value. Changing from 3.0 to 3.0.0 results in proper installation. 3.0 generates a warning, but fails to do the installation (ie it should be an error).

Heroku failing to start my node app because its trying to do it with nodemon

I'm deploying my node app to Heroku and it's trying to invoke it with nodemon rather than the node app.js I have defined. My Procfile looks like this:
web: npm start
And when I push to heroku the dyno crashes with this error:
2014-03-24T19:24:59.669412+00:00 app[web.1]: > my-app#0.0.1 start /app
2014-03-24T19:24:59.669412+00:00 app[web.1]: > nodemon app.js
2014-03-24T19:24:59.669412+00:00 app[web.1]:
2014-03-24T19:24:59.669412+00:00 app[web.1]:
2014-03-24T19:24:59.710228+00:00 app[web.1]:
2014-03-24T19:24:59.701246+00:00 app[web.1]: sh: nodemon: not found
I even tried npm installing nodemon as a package.json dependency, and checking in node_modules/nodemon but no luck. (nodemon needs to be installed with npm install nodemon -g for that to work anyway)
Any ideas?
My package.json:
{
"name": "my-app",
"version": "0.0.1",
"private": true,
"main": "app.js",
"scripts": {
"start": "node app.js"
},
"dependencies": {
"requirejs": "~2.1.10",
"underscore": "~1.5.2",
"express": "~3.4.8",
"ejs": "~0.8.5",
"less-middleware": "~0.1.15",
"socket.io": "~0.9.16",
"tail": "~0.3.5",
"async": "~0.2.10",
"mongoose": "~3.8.5",
"mkdirp": "~0.3.5",
"ejs-locals": "~1.0.2",
"aws-sdk": "~2.0.0-rc8",
"knox": "~0.8.8",
"connect-multiparty": "~1.0.3",
"uuid": "~1.4.1",
"nodemon": "~1.0.14"
},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-requirejs": "~0.4.1",
"grunt-recess": "~0.5.0",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-mocha-test": "~0.9.0",
"grunt-forever": "~0.4.1",
"matchdep": "~0.3.0",
"jshint": "~2.4.3",
"precommit-hook": "~0.3.10",
"mocha": "~1.17.1",
"supertest": "~0.9.0",
"chai": "~1.9.0",
"sinon": "~1.8.2",
"karma-sinon": "~1.0.2",
"karma-script-launcher": "~0.1.0",
"karma-chrome-launcher": "~0.1.2",
"karma-firefox-launcher": "~0.1.3",
"karma-requirejs": "~0.2.1",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jasmine": "~0.1.5",
"karma-coffee-preprocessor": "~0.1.3",
"karma-phantomjs-launcher": "~0.1.2",
"karma": "~0.10.9",
"karma-mocha": "~0.1.1",
"grunt-karma": "~0.6.2",
"karma-chai": "~0.1.0"
},
"config": {
"precommit": {
"lint": true
}
},
"engines": {
"node": "0.10.x"
}
}
Update
Sorry to have left everyone hanging all this time! If I remember correctly my issue in the end was my buildpack which was overriding the web: role in my Procfile.
I've since switched to different buildpacks, namely:
ddollar/heroku-buildpack-multi
With the following .buildpacks file:
ryandotsmith/nginx-buildpack
heroku/heroku-buildpack-nodejs
And my Procfile looks like this:
web: bin/start-nginx ./node_modules/.bin/forever --minUptime 10000 --spinSleepTime 1000 app.js
Change your Procfile to this:
web: node app.js
Being app.js the entry point to your app.
This is assuming you don't really need nodemon in your app, since you have listed it at the package.json sample you provided.
Recently I'm working on deployed my node js appication in heroku by using nodemon, for it's working fine.
we have to follow few step to reslove nodemon is not found.
1)Package.json
npm start: nodemon server.js
2)We need to modified procfile like below.
web: nodemon server.js
3)Use below command line to login for heroku
$ heroku login
4)Create new application
$heroku create <appication-name>
I think most of the developer directly deployed to heroku through github Id. Locally node_modules are work fine ,after deployed your application in heroku (inside we are n't able to access the node_modules), so for that we have access the respository.
5)Clone the repository from heroku
$ heroku git:clone -a <application-name>
$ cd cv-application
Now we are able access the application.
6)Delete you node_modules and try to install package by using below command.
$ npm install.
Deploy your changes.
$ git add .
$ git commit -am "make it better"
$ git push heroku master.
npm version sholud be 6.4.1.
I know that OP got the answer but I thought I might share what worked for me, in a slightly different senario:
Procfile contains the following:
web: npm start
And for my package.json file I defined:
"scripts":{
"start": "node ./bin/www"
}
And that fixed this issue for me.
Include nodemon as dev dependencies not as dependencies.
using this command remove nodemon.
npm uninstall nodemon
now install nodemon
npm install -D nodemon
In production or in deployment you shouldn't be using nodemon.

Resources