Bitbucket Pipelines from Docker Image has Missing NPM Modules - node.js

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.

Related

NPM works differently on the SAME docker image

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?… :/

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

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