Heroku Node.js Angular build failing












1














My app is working fine when hosted locally, but when I try to deploy the build fails with the following output log:



-----> Node.js app detected

-----> Creating runtime environment

NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false

-----> Installing binaries
engines.node (package.json): 8.10.0
engines.npm (package.json): 6.4.1

Resolving node version 8.10.0...
Downloading and installing node 8.10.0...
Bootstrapping npm 6.4.1 (replacing 5.6.0)...
npm 6.4.1 installed

-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build

-----> Building dependencies
Installing node modules (package.json + package-lock)
npm ERR! code EINVALIDTYPE
npm ERR! typeerror Error: Argument #5: Expected object but got string
npm ERR! typeerror at inflatableChild (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:93:3)
npm ERR! typeerror at BB.each (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:55:12)
npm ERR! typeerror at tryCatcher (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
npm ERR! typeerror at Object.gotValue (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:155:18)
npm ERR! typeerror at Object.gotAccum (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:144:25)
npm ERR! typeerror at Object.tryCatcher (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
npm ERR! typeerror at Promise._settlePromiseFromHandler (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
npm ERR! typeerror at Promise._settlePromise (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
npm ERR! typeerror at Promise._settlePromise0 (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
npm ERR! typeerror at Promise._settlePromises (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
npm ERR! typeerror at Async._drainQueue (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
npm ERR! typeerror at Async._drainQueues (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
npm ERR! typeerror at Immediate.Async.drainQueues (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
npm ERR! typeerror at runCallback (timers.js:794:20)
npm ERR! typeerror at tryOnImmediate (timers.js:752:5)
npm ERR! typeerror at processImmediate [as _immediateCallback] (timers.js:729:5)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.Mus2Z/_logs/2018-11-18T01_38_26_671Z-debug.log
-----> Build failed

We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys

If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/

Love,
Heroku

! Push rejected, failed to compile Node.js app.
! Push failed


Here is my package.json file:



{
"name": "scheduling",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "node server.js",
"postinstall": "ng build --aot --target=production"
},
"engines": {
"node": "8.10.0",
"npm" : "6.4.1"
},
"repository": {
"type": "git",
"url": "https://github.com/ActionPackedJack/Restaurant-Schedule"
},
"keywords": ,
"author": "",
"license": "ISC",
"dependencies": {
"@angular/cli": ">=1.0.3",
"@angular/compiler-cli": ">=4.0.0",
"express": "^4.16.3",
"jquery": "^3.3.1",
"mongoose": "^5.2.2",
"rxjs": "^6.2.1",
"rxjs-compat": "^6.2.1",
"typescript": ">=2.2.0"
}
}


And here is my server.js:



var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.set('port', (process.env.PORT || 5000));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended : true}))
var path = require('path');
app.use(express.static(path.join(__dirname, './public/dist/public/')));
app.get('/*', function(req,res){
res.sendFile(path.join(__dirname, '/public/dist'));
})
//app.set('views', path.join(__dirname, '/public/dist'))
require('./server/config/mongoose.js');
var routes_setter = require('./server/config/routes.js');
routes_setter(app);
app.listen(app.get('port'), function(){
console.log('Node app is running on port', app.get('port'))
});


I read another instance of a user solving this problem by deleting their package-lock.json file, but trying that resulted in a different error, "The build command requires to be run in an Angular project, but a project definition could not be found."



Any thoughts would be greatly appreciated, please and thank you!










share|improve this question






















  • removing package-lock.json file did work for me
    – georgej
    Dec 3 '18 at 2:40
















1














My app is working fine when hosted locally, but when I try to deploy the build fails with the following output log:



-----> Node.js app detected

-----> Creating runtime environment

NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false

-----> Installing binaries
engines.node (package.json): 8.10.0
engines.npm (package.json): 6.4.1

Resolving node version 8.10.0...
Downloading and installing node 8.10.0...
Bootstrapping npm 6.4.1 (replacing 5.6.0)...
npm 6.4.1 installed

-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build

-----> Building dependencies
Installing node modules (package.json + package-lock)
npm ERR! code EINVALIDTYPE
npm ERR! typeerror Error: Argument #5: Expected object but got string
npm ERR! typeerror at inflatableChild (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:93:3)
npm ERR! typeerror at BB.each (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:55:12)
npm ERR! typeerror at tryCatcher (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
npm ERR! typeerror at Object.gotValue (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:155:18)
npm ERR! typeerror at Object.gotAccum (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:144:25)
npm ERR! typeerror at Object.tryCatcher (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
npm ERR! typeerror at Promise._settlePromiseFromHandler (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
npm ERR! typeerror at Promise._settlePromise (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
npm ERR! typeerror at Promise._settlePromise0 (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
npm ERR! typeerror at Promise._settlePromises (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
npm ERR! typeerror at Async._drainQueue (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
npm ERR! typeerror at Async._drainQueues (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
npm ERR! typeerror at Immediate.Async.drainQueues (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
npm ERR! typeerror at runCallback (timers.js:794:20)
npm ERR! typeerror at tryOnImmediate (timers.js:752:5)
npm ERR! typeerror at processImmediate [as _immediateCallback] (timers.js:729:5)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.Mus2Z/_logs/2018-11-18T01_38_26_671Z-debug.log
-----> Build failed

We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys

If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/

Love,
Heroku

! Push rejected, failed to compile Node.js app.
! Push failed


Here is my package.json file:



{
"name": "scheduling",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "node server.js",
"postinstall": "ng build --aot --target=production"
},
"engines": {
"node": "8.10.0",
"npm" : "6.4.1"
},
"repository": {
"type": "git",
"url": "https://github.com/ActionPackedJack/Restaurant-Schedule"
},
"keywords": ,
"author": "",
"license": "ISC",
"dependencies": {
"@angular/cli": ">=1.0.3",
"@angular/compiler-cli": ">=4.0.0",
"express": "^4.16.3",
"jquery": "^3.3.1",
"mongoose": "^5.2.2",
"rxjs": "^6.2.1",
"rxjs-compat": "^6.2.1",
"typescript": ">=2.2.0"
}
}


And here is my server.js:



var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.set('port', (process.env.PORT || 5000));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended : true}))
var path = require('path');
app.use(express.static(path.join(__dirname, './public/dist/public/')));
app.get('/*', function(req,res){
res.sendFile(path.join(__dirname, '/public/dist'));
})
//app.set('views', path.join(__dirname, '/public/dist'))
require('./server/config/mongoose.js');
var routes_setter = require('./server/config/routes.js');
routes_setter(app);
app.listen(app.get('port'), function(){
console.log('Node app is running on port', app.get('port'))
});


I read another instance of a user solving this problem by deleting their package-lock.json file, but trying that resulted in a different error, "The build command requires to be run in an Angular project, but a project definition could not be found."



Any thoughts would be greatly appreciated, please and thank you!










share|improve this question






















  • removing package-lock.json file did work for me
    – georgej
    Dec 3 '18 at 2:40














1












1








1







My app is working fine when hosted locally, but when I try to deploy the build fails with the following output log:



-----> Node.js app detected

-----> Creating runtime environment

NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false

-----> Installing binaries
engines.node (package.json): 8.10.0
engines.npm (package.json): 6.4.1

Resolving node version 8.10.0...
Downloading and installing node 8.10.0...
Bootstrapping npm 6.4.1 (replacing 5.6.0)...
npm 6.4.1 installed

-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build

-----> Building dependencies
Installing node modules (package.json + package-lock)
npm ERR! code EINVALIDTYPE
npm ERR! typeerror Error: Argument #5: Expected object but got string
npm ERR! typeerror at inflatableChild (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:93:3)
npm ERR! typeerror at BB.each (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:55:12)
npm ERR! typeerror at tryCatcher (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
npm ERR! typeerror at Object.gotValue (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:155:18)
npm ERR! typeerror at Object.gotAccum (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:144:25)
npm ERR! typeerror at Object.tryCatcher (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
npm ERR! typeerror at Promise._settlePromiseFromHandler (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
npm ERR! typeerror at Promise._settlePromise (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
npm ERR! typeerror at Promise._settlePromise0 (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
npm ERR! typeerror at Promise._settlePromises (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
npm ERR! typeerror at Async._drainQueue (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
npm ERR! typeerror at Async._drainQueues (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
npm ERR! typeerror at Immediate.Async.drainQueues (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
npm ERR! typeerror at runCallback (timers.js:794:20)
npm ERR! typeerror at tryOnImmediate (timers.js:752:5)
npm ERR! typeerror at processImmediate [as _immediateCallback] (timers.js:729:5)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.Mus2Z/_logs/2018-11-18T01_38_26_671Z-debug.log
-----> Build failed

We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys

If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/

Love,
Heroku

! Push rejected, failed to compile Node.js app.
! Push failed


Here is my package.json file:



{
"name": "scheduling",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "node server.js",
"postinstall": "ng build --aot --target=production"
},
"engines": {
"node": "8.10.0",
"npm" : "6.4.1"
},
"repository": {
"type": "git",
"url": "https://github.com/ActionPackedJack/Restaurant-Schedule"
},
"keywords": ,
"author": "",
"license": "ISC",
"dependencies": {
"@angular/cli": ">=1.0.3",
"@angular/compiler-cli": ">=4.0.0",
"express": "^4.16.3",
"jquery": "^3.3.1",
"mongoose": "^5.2.2",
"rxjs": "^6.2.1",
"rxjs-compat": "^6.2.1",
"typescript": ">=2.2.0"
}
}


And here is my server.js:



var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.set('port', (process.env.PORT || 5000));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended : true}))
var path = require('path');
app.use(express.static(path.join(__dirname, './public/dist/public/')));
app.get('/*', function(req,res){
res.sendFile(path.join(__dirname, '/public/dist'));
})
//app.set('views', path.join(__dirname, '/public/dist'))
require('./server/config/mongoose.js');
var routes_setter = require('./server/config/routes.js');
routes_setter(app);
app.listen(app.get('port'), function(){
console.log('Node app is running on port', app.get('port'))
});


I read another instance of a user solving this problem by deleting their package-lock.json file, but trying that resulted in a different error, "The build command requires to be run in an Angular project, but a project definition could not be found."



Any thoughts would be greatly appreciated, please and thank you!










share|improve this question













My app is working fine when hosted locally, but when I try to deploy the build fails with the following output log:



-----> Node.js app detected

-----> Creating runtime environment

NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false

-----> Installing binaries
engines.node (package.json): 8.10.0
engines.npm (package.json): 6.4.1

Resolving node version 8.10.0...
Downloading and installing node 8.10.0...
Bootstrapping npm 6.4.1 (replacing 5.6.0)...
npm 6.4.1 installed

-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build

-----> Building dependencies
Installing node modules (package.json + package-lock)
npm ERR! code EINVALIDTYPE
npm ERR! typeerror Error: Argument #5: Expected object but got string
npm ERR! typeerror at inflatableChild (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:93:3)
npm ERR! typeerror at BB.each (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/lib/install/inflate-shrinkwrap.js:55:12)
npm ERR! typeerror at tryCatcher (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
npm ERR! typeerror at Object.gotValue (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:155:18)
npm ERR! typeerror at Object.gotAccum (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/reduce.js:144:25)
npm ERR! typeerror at Object.tryCatcher (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
npm ERR! typeerror at Promise._settlePromiseFromHandler (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
npm ERR! typeerror at Promise._settlePromise (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
npm ERR! typeerror at Promise._settlePromise0 (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
npm ERR! typeerror at Promise._settlePromises (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
npm ERR! typeerror at Async._drainQueue (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
npm ERR! typeerror at Async._drainQueues (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
npm ERR! typeerror at Immediate.Async.drainQueues (/tmp/build_8521c67f1a08023343c4f34aedc664fb/.heroku/node/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
npm ERR! typeerror at runCallback (timers.js:794:20)
npm ERR! typeerror at tryOnImmediate (timers.js:752:5)
npm ERR! typeerror at processImmediate [as _immediateCallback] (timers.js:729:5)
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.Mus2Z/_logs/2018-11-18T01_38_26_671Z-debug.log
-----> Build failed

We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys

If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/

Love,
Heroku

! Push rejected, failed to compile Node.js app.
! Push failed


Here is my package.json file:



{
"name": "scheduling",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "node server.js",
"postinstall": "ng build --aot --target=production"
},
"engines": {
"node": "8.10.0",
"npm" : "6.4.1"
},
"repository": {
"type": "git",
"url": "https://github.com/ActionPackedJack/Restaurant-Schedule"
},
"keywords": ,
"author": "",
"license": "ISC",
"dependencies": {
"@angular/cli": ">=1.0.3",
"@angular/compiler-cli": ">=4.0.0",
"express": "^4.16.3",
"jquery": "^3.3.1",
"mongoose": "^5.2.2",
"rxjs": "^6.2.1",
"rxjs-compat": "^6.2.1",
"typescript": ">=2.2.0"
}
}


And here is my server.js:



var express = require('express');
var app = express();
var bodyParser = require('body-parser');
app.set('port', (process.env.PORT || 5000));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended : true}))
var path = require('path');
app.use(express.static(path.join(__dirname, './public/dist/public/')));
app.get('/*', function(req,res){
res.sendFile(path.join(__dirname, '/public/dist'));
})
//app.set('views', path.join(__dirname, '/public/dist'))
require('./server/config/mongoose.js');
var routes_setter = require('./server/config/routes.js');
routes_setter(app);
app.listen(app.get('port'), function(){
console.log('Node app is running on port', app.get('port'))
});


I read another instance of a user solving this problem by deleting their package-lock.json file, but trying that resulted in a different error, "The build command requires to be run in an Angular project, but a project definition could not be found."



Any thoughts would be greatly appreciated, please and thank you!







angular heroku npm deployment package.json






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 18 '18 at 1:57









Adam

61




61












  • removing package-lock.json file did work for me
    – georgej
    Dec 3 '18 at 2:40


















  • removing package-lock.json file did work for me
    – georgej
    Dec 3 '18 at 2:40
















removing package-lock.json file did work for me
– georgej
Dec 3 '18 at 2:40




removing package-lock.json file did work for me
– georgej
Dec 3 '18 at 2:40












1 Answer
1






active

oldest

votes


















0














Your package.json doesn't have devDependencies, are they needed?



I followed this link:
https://medium.com/@hellotunmbi/how-to-deploy-angular-application-to-heroku-1d56e09c5147
but pay attention to his updated link for updates:
https://medium.com/@shubhsharma10/how-to-deploy-angular-6-app-to-heroku-52b73ac7a3aa



My package.json file in my heroku app looks like:



{
"name": "my-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "node server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ng build --aot --prod"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.0.0",
"@angular/common": "~7.0.0",
"@angular/compiler": "~7.0.0",
"@angular/compiler-cli": "^7.0.3",
"@angular/core": "~7.0.0",
"@angular/forms": "~7.0.0",
"@angular/http": "~7.0.0",
"@angular/platform-browser": "~7.0.0",
"@angular/platform-browser-dynamic": "~7.0.0",
"@angular/router": "~7.0.0",
"angular-font-awesome": "^3.1.2",
"bootstrap": "^4.1.3",
"core-js": "^2.5.4",
"curl": "^0.1.4",
"express": "^4.16.4",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"latest": "^0.2.0",
"path": "^0.12.7",
"popper.js": "^1.12.9",
"rxjs": "^6.3.3",
"typescript": "~3.1.1",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "^7.0.5",
"@angular/compiler-cli": "^7.0.3",
"@angular/language-service": "~7.0.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"enhanced-resolve": "^4.1.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.1"
},
"engines": {
"node": "10.12.0",
"npm": "6.4.1"
}
}





share|improve this answer



















  • 1




    Ooh, that was really helpful. I had a lot of other bizarre file paths and such to reconcile, but those dependency declarations seemed like part of the solution. Finally up and running. Thanks!
    – Adam
    Nov 19 '18 at 3:29










  • Happy it all worked out.
    – Mark B
    Nov 21 '18 at 1:11











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53357246%2fheroku-node-js-angular-build-failing%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Your package.json doesn't have devDependencies, are they needed?



I followed this link:
https://medium.com/@hellotunmbi/how-to-deploy-angular-application-to-heroku-1d56e09c5147
but pay attention to his updated link for updates:
https://medium.com/@shubhsharma10/how-to-deploy-angular-6-app-to-heroku-52b73ac7a3aa



My package.json file in my heroku app looks like:



{
"name": "my-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "node server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ng build --aot --prod"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.0.0",
"@angular/common": "~7.0.0",
"@angular/compiler": "~7.0.0",
"@angular/compiler-cli": "^7.0.3",
"@angular/core": "~7.0.0",
"@angular/forms": "~7.0.0",
"@angular/http": "~7.0.0",
"@angular/platform-browser": "~7.0.0",
"@angular/platform-browser-dynamic": "~7.0.0",
"@angular/router": "~7.0.0",
"angular-font-awesome": "^3.1.2",
"bootstrap": "^4.1.3",
"core-js": "^2.5.4",
"curl": "^0.1.4",
"express": "^4.16.4",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"latest": "^0.2.0",
"path": "^0.12.7",
"popper.js": "^1.12.9",
"rxjs": "^6.3.3",
"typescript": "~3.1.1",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "^7.0.5",
"@angular/compiler-cli": "^7.0.3",
"@angular/language-service": "~7.0.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"enhanced-resolve": "^4.1.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.1"
},
"engines": {
"node": "10.12.0",
"npm": "6.4.1"
}
}





share|improve this answer



















  • 1




    Ooh, that was really helpful. I had a lot of other bizarre file paths and such to reconcile, but those dependency declarations seemed like part of the solution. Finally up and running. Thanks!
    – Adam
    Nov 19 '18 at 3:29










  • Happy it all worked out.
    – Mark B
    Nov 21 '18 at 1:11
















0














Your package.json doesn't have devDependencies, are they needed?



I followed this link:
https://medium.com/@hellotunmbi/how-to-deploy-angular-application-to-heroku-1d56e09c5147
but pay attention to his updated link for updates:
https://medium.com/@shubhsharma10/how-to-deploy-angular-6-app-to-heroku-52b73ac7a3aa



My package.json file in my heroku app looks like:



{
"name": "my-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "node server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ng build --aot --prod"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.0.0",
"@angular/common": "~7.0.0",
"@angular/compiler": "~7.0.0",
"@angular/compiler-cli": "^7.0.3",
"@angular/core": "~7.0.0",
"@angular/forms": "~7.0.0",
"@angular/http": "~7.0.0",
"@angular/platform-browser": "~7.0.0",
"@angular/platform-browser-dynamic": "~7.0.0",
"@angular/router": "~7.0.0",
"angular-font-awesome": "^3.1.2",
"bootstrap": "^4.1.3",
"core-js": "^2.5.4",
"curl": "^0.1.4",
"express": "^4.16.4",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"latest": "^0.2.0",
"path": "^0.12.7",
"popper.js": "^1.12.9",
"rxjs": "^6.3.3",
"typescript": "~3.1.1",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "^7.0.5",
"@angular/compiler-cli": "^7.0.3",
"@angular/language-service": "~7.0.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"enhanced-resolve": "^4.1.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.1"
},
"engines": {
"node": "10.12.0",
"npm": "6.4.1"
}
}





share|improve this answer



















  • 1




    Ooh, that was really helpful. I had a lot of other bizarre file paths and such to reconcile, but those dependency declarations seemed like part of the solution. Finally up and running. Thanks!
    – Adam
    Nov 19 '18 at 3:29










  • Happy it all worked out.
    – Mark B
    Nov 21 '18 at 1:11














0












0








0






Your package.json doesn't have devDependencies, are they needed?



I followed this link:
https://medium.com/@hellotunmbi/how-to-deploy-angular-application-to-heroku-1d56e09c5147
but pay attention to his updated link for updates:
https://medium.com/@shubhsharma10/how-to-deploy-angular-6-app-to-heroku-52b73ac7a3aa



My package.json file in my heroku app looks like:



{
"name": "my-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "node server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ng build --aot --prod"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.0.0",
"@angular/common": "~7.0.0",
"@angular/compiler": "~7.0.0",
"@angular/compiler-cli": "^7.0.3",
"@angular/core": "~7.0.0",
"@angular/forms": "~7.0.0",
"@angular/http": "~7.0.0",
"@angular/platform-browser": "~7.0.0",
"@angular/platform-browser-dynamic": "~7.0.0",
"@angular/router": "~7.0.0",
"angular-font-awesome": "^3.1.2",
"bootstrap": "^4.1.3",
"core-js": "^2.5.4",
"curl": "^0.1.4",
"express": "^4.16.4",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"latest": "^0.2.0",
"path": "^0.12.7",
"popper.js": "^1.12.9",
"rxjs": "^6.3.3",
"typescript": "~3.1.1",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "^7.0.5",
"@angular/compiler-cli": "^7.0.3",
"@angular/language-service": "~7.0.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"enhanced-resolve": "^4.1.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.1"
},
"engines": {
"node": "10.12.0",
"npm": "6.4.1"
}
}





share|improve this answer














Your package.json doesn't have devDependencies, are they needed?



I followed this link:
https://medium.com/@hellotunmbi/how-to-deploy-angular-application-to-heroku-1d56e09c5147
but pay attention to his updated link for updates:
https://medium.com/@shubhsharma10/how-to-deploy-angular-6-app-to-heroku-52b73ac7a3aa



My package.json file in my heroku app looks like:



{
"name": "my-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "node server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ng build --aot --prod"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.0.0",
"@angular/common": "~7.0.0",
"@angular/compiler": "~7.0.0",
"@angular/compiler-cli": "^7.0.3",
"@angular/core": "~7.0.0",
"@angular/forms": "~7.0.0",
"@angular/http": "~7.0.0",
"@angular/platform-browser": "~7.0.0",
"@angular/platform-browser-dynamic": "~7.0.0",
"@angular/router": "~7.0.0",
"angular-font-awesome": "^3.1.2",
"bootstrap": "^4.1.3",
"core-js": "^2.5.4",
"curl": "^0.1.4",
"express": "^4.16.4",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"latest": "^0.2.0",
"path": "^0.12.7",
"popper.js": "^1.12.9",
"rxjs": "^6.3.3",
"typescript": "~3.1.1",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "^7.0.5",
"@angular/compiler-cli": "^7.0.3",
"@angular/language-service": "~7.0.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"enhanced-resolve": "^4.1.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.1"
},
"engines": {
"node": "10.12.0",
"npm": "6.4.1"
}
}






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 18 '18 at 15:19

























answered Nov 18 '18 at 2:59









Mark B

6619




6619








  • 1




    Ooh, that was really helpful. I had a lot of other bizarre file paths and such to reconcile, but those dependency declarations seemed like part of the solution. Finally up and running. Thanks!
    – Adam
    Nov 19 '18 at 3:29










  • Happy it all worked out.
    – Mark B
    Nov 21 '18 at 1:11














  • 1




    Ooh, that was really helpful. I had a lot of other bizarre file paths and such to reconcile, but those dependency declarations seemed like part of the solution. Finally up and running. Thanks!
    – Adam
    Nov 19 '18 at 3:29










  • Happy it all worked out.
    – Mark B
    Nov 21 '18 at 1:11








1




1




Ooh, that was really helpful. I had a lot of other bizarre file paths and such to reconcile, but those dependency declarations seemed like part of the solution. Finally up and running. Thanks!
– Adam
Nov 19 '18 at 3:29




Ooh, that was really helpful. I had a lot of other bizarre file paths and such to reconcile, but those dependency declarations seemed like part of the solution. Finally up and running. Thanks!
– Adam
Nov 19 '18 at 3:29












Happy it all worked out.
– Mark B
Nov 21 '18 at 1:11




Happy it all worked out.
– Mark B
Nov 21 '18 at 1:11


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53357246%2fheroku-node-js-angular-build-failing%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?