NPM works differently on the SAME docker image - node.js

I can't get assets compilation work on a dev's machine. Here's some specs:
1 Laravel 5.3
2 package.json:
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch",
"build": "gulp"
},
"devDependencies": {
"bootstrap-sass": "^3.3.7",
"del": "^2.2.2",
"eslint": "^4.12.1",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.0-beta.2",
"gentelella": "^1.3.0",
"gulp": "^3.9.1",
"jquery": "^3.2.1",
"laravel-echo": "^1.3.0",
"laravel-elixir": "^6.0.0-15",
"laravel-elixir-vue-2": "^0.3.0",
"laravel-elixir-webpack-official": "^1.0.10",
"laravel-elixir-webpack-react": "^1.0.1",
"laravel-vue-pagination": "^1.2.0",
"lodash": "^4.17.4",
"moment": "^2.18.1",
"portal-vue": "^1.3.0",
"pusher-js": "^4.1.0",
"vue": "^2.4.1",
"vue-resource": "^1.3.4",
"vuedraggable": "^2.14.1"
},
"dependencies": {}
}
3 My OS: Mac OS X High Sierra.
4 Dev's OS: Debian 9
5 We both have the same node & npm versions installed.
6 I can do both npm install and npm run dev.
7 The dev can only do npm install. The second command produces errors like:
Error: ./resources/assets/js/app.js
Module build failed: TypeError: fileSystem.statSync is not a function
at module.exports (/home/thedev/Work/lo/project/node_modules/babel-loader/lib/utils/exists.js:7:25)
at find (/home/thedev/Work/lo/project/node_modules/babel-loader/lib/resolve-rc.js:13:9)
8 Now, the interesting part. In order to make it "the same", I've prepared a docker image. Here's the Dokerfile:
FROM node:alpine
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
9 Building/running the image:
# Host OS:
cd /path/to/project && docker build -t mappanel-npm dev-assets
docker run -v "$PWD":/home/node/app --name=mappanel-npm -it mappanel-npm /bin/bash
# Inside the container:
cd /home/node/app/
rm -rf node_modules package-lock.json
npm install
npm run dev
RESULT: Everything's good on my side (just like running npm on the host). The Dev has the same errors as before!!
[07:34:55] webpack is watching for changes
[07:34:55]
ERROR in ./resources/assets/js/test.js
Module build failed: TypeError: fileSystem.statSync is not a function
at module.exports (/home/node/app/node_modules/babel-loader/lib/utils/exists.js:7:25)
at find (/home/node/app/node_modules/babel-loader/lib/resolve-rc.js:13:9)
at Object.module.exports (/home/node/app/node_modules/babel-loader/lib/index.js:111:132)
How come?… :/

Related

sh: 1: nodemon: not found on Docker compose

I am having serious issues setting up docker. When I run sudo docker-compose up -d and sudo docker-compose logs -f my app is logging sh: 1: nodemon: not found over and over again. The problem is that I don't even have nodemon anymore : /
If I run the exact same project with npm start and manually turn on mysql it works.
My dockerfile:
FROM node:latest
# Create app directory
WORKDIR ./
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm#5+)
COPY package*.json ./
#WORKDIR /node_modules
RUN npm ci --only=production
RUN npm install
# Bundle app source
COPY . .
EXPOSE 8003
CMD [ "npm", "start" ]
My package.json:
{
"name": "name",
"version": "6.4",
"description": "sdasdsadsad",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node --inspect=0.0.0.0 app.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.25.0",
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
"compression": "^1.7.4",
"connect-flash": "^0.1.1",
"cookie-parser": "^1.4.5",
"dotenv": "^10.0.0",
"ejs": "^3.1.6",
"express": "^4.17.1",
"express-flash": "^0.0.2",
"express-flash-messages": "^0.1.1",
"express-formidable": "^1.2.0",
"express-mysql-session": "^2.1.7",
"express-session": "^1.17.2",
"express-validator": "5.3.1",
"helmet": "^4.6.0",
"jsonwebtoken": "^8.5.1",
"multer": "^1.4.3",
"mysql": "^2.18.1",
"mysql-pool-booster": "^1.0.3",
"node-lame": "^1.3.2",
"nodemailer": "^6.7.0",
"sharp": "^0.29.1",
"uglify-js": "^3.14.5",
"uglifycss": "^0.0.29",
"util.promisify": "^1.1.1"
}
}
My docker-compose and package-lock.json also don't contain nodemon anymore...
Delete package lock file and Try using this command to rebuild the container.
sudo docker-compose up -d --build

How to create Docker image of ubuntu for node.js application

I am new to docker build feature. I am trying to create docker image for my node.js application, however I am facing issue.
1) It shows image is create but when I am trying to docker run its give error like
"module.js:550
throw err;
^
Error: Cannot find module '
I think there is some issue with my docker file. Which I have created but I didn't get what exactly issue is
my Dockerfile
FROM ubuntu:16.04
RUN apt-get update -y
RUN apt-get install g++ -y
RUN apt install curl -y
RUN curl --silent --location https://deb.nodesource.com/setup_8.x — Node.js 8 LTS "Carbon" | bash -
RUN apt-get install --yes nodejs
RUN apt-get install --yes build-essential
# check the path
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 9012
CMD ["node", "app.js"]
Also see the my package.json for more info. of modules.
{
"name": "service",
"version": "0.0.0",
"private": true,
"scripts": {
"serve": "nodemon app.js"
},
"description": "test",
"author": {
"name": "caitayl"
},
"dependencies": {
"body-parser": "~1.8.1",
"config": "^1.28.1",
"cookie-parser": "~1.3.3",
"cors": "^2.8.5",
"debug": "~2.0.0",
"ejs": "^2.7.1",
"express": "^4.17.1",
"fabric-ca-client": "~1.4.0",
"fabric-network": "~1.4.0",
"firebase": "^6.4.0",
"firebase-admin": "^8.4.0",
"http-errors": "~1.6.3",
"json-server": "^0.15.0",
"lodash": "^4.17.15",
"method-override": "^2.3.10",
"mongodb": "^3.4.1",
"morgan": "~1.9.1",
"multer": "^1.4.1",
"nexmo": "^2.4.1",
"node-gyp": "^5.0.3",
"node-pre-gyp": "^0.13.0",
"node-rest-client": "^3.1.0",
"os": "^0.1.1",
"paypal-rest-sdk": "^1.8.1",
"qs": "^6.8.0",
"sendotp": "^1.2.9",
"socket.io": "^2.2.0",
"winston": "^2.4.2",
"winston-mongodb": "^2.0.10"
},
"devDependencies": {
"nodemon": "^1.19.1"
}
}
Why You make nodejs image from ubuntu when there are already official ones.
I see issue - You've overengineered You Dockerfile with unnecessary steps.
Fix Your Dockerfile and try again:
FROM node:8-alpine3.9
RUN apk update
RUN apk add --no-cache g++ make python python-dev
RUN rm -rf /var/cache/apk/*
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
EXPOSE 9012
CMD node app.js
From last collaboration I found that it was a typo in code where You required file from not existing folder.
"module.js:550 throw err; ^ Error: Cannot find module '../dFarmUserService/controllers/ClientRegisterController'
So fixed it together :)

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.

Trouble deploying nodejs app to heroku

I'm trying to deploy a nodejs app to heroku and I am getting the following error when I check the heroku logs,
sh:1: npm-run-all : not found
My package.json looks like this
{
"name": "web-training",
"version": "1.0.0",
"description": "web-training",
"scripts": {
"prestart": "babel-node tools/startMessage.js",
"start": "npm-run-all --parallel open:src lint:watch test:watch",
"open:src": "babel-node tools/srcServer.js",
"lint": "node_modules/.bin/esw webpack.config.* src tools",
"lint:watch": "npm run lint -- --watch",
"test": "mocha --reporter spec tools/testSetup.js \"src/**/*.test.js\"",
"test:watch": "npm run test -- --watch",
"clean-dist": "npm run remove-dist && mkdirp dist-server/dist",
"remove-dist": "node_modules/.bin/rimraf ./dist-server/dist",
"build:html": "babel-node tools/buildHtml.js",
"prebuild": "npm-run-all clean-dist test lint build:html",
"build": "babel-node tools/build.js",
"postbuild": "babel-node dist-server/server.js"
},
"author": "Cory House",
"license": "MIT",
"dependencies": {
"babel-polyfill": "6.8.0",
"bootstrap": "3.3.6",
"compression": "^1.6.1",
"express": "^4.13.4",
"install": "^0.8.4",
"jquery": "2.2.3",
"material-ui": "^0.16.7",
"npm": "^4.0.5",
"open": "0.0.5",
"rd-react-overlay": "^1.4.2",
"react": "15.0.2",
"react-dom": "15.0.2",
"react-native-search-bar": "^2.16.0",
"react-native-vector-icons": "^4.0.0",
"react-redux": "4.4.5",
"react-router": "2.4.0",
"react-router-redux": "4.0.4",
"react-skylight": "^0.4.1",
"react-tap-event-plugin": "^2.0.1",
"redux": "3.5.2",
"redux-thunk": "2.0.1",
"toastr": "2.1.2"
},
"devDependencies": {
"axios-mock-adapter": "^1.7.1",
"babel-cli": "6.8.0",
"babel-core": "6.8.0",
"babel-loader": "6.2.4",
"babel-plugin-react-display-name": "2.0.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-react": "6.5.0",
"babel-preset-react-hmre": "1.1.1",
"babel-register": "6.8.0",
"colors": "1.1.2",
"compression": "1.6.1",
"cross-env": "1.0.7",
"css-loader": "0.23.1",
"enzyme": "2.2.0",
"eslint": "2.9.0",
"eslint-plugin-import": "1.6.1",
"eslint-plugin-react": "5.0.1",
"eslint-watch": "2.1.11",
"eventsource-polyfill": "0.9.6",
"expect": "1.19.0",
"express": "4.13.4",
"extract-text-webpack-plugin": "1.0.1",
"file-loader": "0.8.5",
"jsdom": "8.5.0",
"mocha": "2.4.5",
"nock": "8.0.0",
"npm-run-all": "1.8.0",
"open": "0.0.5",
"react-addons-test-utils": "15.0.2",
"react-search-component": "^1.1.2",
"redux-immutable-state-invariant": "1.2.3",
"redux-mock-store": "1.0.2",
"rimraf": "2.5.2",
"style-loader": "0.13.1",
"url-loader": "0.5.7",
"webpack": "1.13.0",
"webpack-dev-middleware": "1.6.1",
"webpack-hot-middleware": "2.10.0"
},
"repository": {
"type": "git",
"url": "https://github.com/XXX/YYY"
}
}
When I run my app locally with npm run build in the command line, it works perfectly.
Any suggestions?
I'm adding Procfile content:
web:npm run build
I'm not sure that's ok.
You'll need npm-run-all added to your "dependancies" and not on your "devDependancies" in your package.json.
This is because on deploying to Heroku, npm prunes your "devDependancies" when making a production build.
Just wanted to share my experience since I had a similar issue when deploying to Heroku using npm-run-all.
It seems like Heroku runs the start script by default when building the application and is unable to run npm-run-all successfully (I found out after running heroku logs in my terminal). I originally had my scripts like this (notice how I'm using npm-run-all in my start script) and encountered an application error.
I simply changed the start script back to just node server.js and created a new script to run npm-run-all, like this. This worked for me.
(Sorry about the image links. SO won't let me post images unless I have at least 10 reputation.)
Hope this helps anyone else encountering the same problem.
· Firstly make your account in git and heroku
· Install git and heroku on your system..if your using windows must install git bash
· Make your repository in git
· Now find out command below
-git init
-git clone {git repository url}
-cd {repository folder name}
· Copy your code on your local git repository folder
· Open terminal go to your repository folder then apply below commands
-git init
-git add *
-git commit -m "your comment"
-git status
-git push origin master
· Check your git repository on git cloud
· Open new terminal apply below commands
-git clone {repository url}
-cd {repository url}
-heroku login
-heroku create {name of your application on heroku}
-git remote(to verify heroku)
-git push heroku master
-heroku open
**Please follow above steps for deploy your code in heroku*
You can make demo node js project for heroku deployment by using below commands
express {name of project} --ejs
cd {name of project}
npm install
npm start

Deploying to heroku with grunt, bower, node modules

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.

Resources