Below is the log when I deploy/push to Heroku. I'm very new to this and have tried extensive research on what could be the root error but alas, I must ask. I've had a running app on Heroku before, but I've made some changes locally and then deleted the Heroku app and decided to change the remote. Here is a link to my Github: https://github.com/tomtam6/tom-tam.git
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=true
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): 6.11.0
engines.npm (package.json): 3.10.10
Resolving node version 6.11.0...
Downloading and installing node 6.11.0...
npm 3.10.10 already installed with node
-----> Restoring cache
Loading 2 from cacheDirectories (default):
- node_modules (exists - skipping)
- bower_components (not cached - skipping)
-----> Building dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
body-parser#1.17.2 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/body-parser
bytes#2.4.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/bytes
content-type#1.0.2 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/content-type
debug#2.6.7 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/body-parser/node_modules/debug
ms#2.0.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/ms
depd#1.1.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/depd
http-errors#1.6.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/http-errors
inherits#2.0.3 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/inherits
setprototypeof#1.0.3 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/setprototypeof
statuses#1.3.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/statuses
iconv-lite#0.4.15 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/iconv-lite
on-finished#2.3.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/on-finished
ee-first#1.1.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/ee-first
qs#6.4.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/qs
raw-body#2.2.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/raw-body
unpipe#1.0.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/unpipe
type-is#1.6.15 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/type-is
media-typer#0.3.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/media-typer
mime-types#2.1.16 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/mime-types
mime-db#1.29.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/mime-db
cookie-parser#1.4.3 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/cookie-parser
cookie#0.3.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/cookie
cookie-signature#1.0.6 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/cookie-signature
debug#2.6.8 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/debug
ejs#2.5.6 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/ejs
express#4.15.3 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/express
accepts#1.3.3 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/accepts
negotiator#0.6.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/negotiator
array-flatten#1.1.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/array-flatten
content-disposition#0.5.2 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/content-disposition
debug#2.6.7 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/express/node_modules/debug
encodeurl#1.0.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/encodeurl
escape-html#1.0.3 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/escape-html
etag#1.8.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/etag
finalhandler#1.0.3 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/finalhandler
debug#2.6.7 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/finalhandler/node_modules/debug
parseurl#1.3.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/parseurl
fresh#0.5.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/fresh
merge-descriptors#1.0.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/merge-descriptors
methods#1.1.2 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/methods
path-to-regexp#0.1.7 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/path-to-regexp
proxy-addr#1.1.4 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/proxy-addr
forwarded#0.1.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/forwarded
ipaddr.js#1.3.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/ipaddr.js
range-parser#1.2.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/range-parser
send#0.15.3 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/send
debug#2.6.7 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/send/node_modules/debug
destroy#1.0.4 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/destroy
mime#1.3.4 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/mime
serve-static#1.12.3 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/serve-static
utils-merge#1.0.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/utils-merge
vary#1.1.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/vary
morgan#1.8.2 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/morgan
basic-auth#1.1.0 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/basic-auth
on-headers#1.0.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/on-headers
serve-favicon#2.4.3 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/serve-favicon
safe-buffer#5.0.1 /tmp/build_af04dccbe55a579f742b63b9b9775aa9/node_modules/safe-buffer
Installing any new modules (package.json)
-----> Caching build
Clearing previous node cache
Saving 2 cacheDirectories (default):
- node_modules
- bower_components (nothing to cache)
-----> Build succeeded!
-----> Discovering process types
Procfile declares types -> web
-----> Compressing...
Done: 14.9M
-----> Launching...
Released v4
https://tom-tam.herokuapp.com/ deployed to Heroku
When you check out your heroku desktop, in the "overview" tab for your app, does it show that your last build succeeded or failed?
And when you check out the logs, does it show the app is up and running?
--edit based on comment discussion--
Add this to app.js, before module.exports = app;
const PORT = process.env.PORT || 8000; app.listen(PORT, () => { console.log(`App listening on port ${PORT}!`); });
Related
I want to deploy my exiting project on heroku, but it gives me an error.
structure of my file:
___instagram
__backend
_controllers
_images
_middleware
_models
_node_modules
_routes
_utiles
.gitignore
app.js
package-lock.json
package.json
Procfile
__ui
...
commands:
E:\Coding\projects\instagram>git add .
E:\Coding\projects\instagram>git commit -m "update controllers"
[master 086d891] update controllers
1 file changed, 1 insertion(+), 1 deletion(-)
E:\Coding\projects\instagram>cd backend
E:\Coding\projects\instagram\backend>git push -f heroku master
after the last command (git push -f heroku master) i got this error:
E:\Coding\projects\instagram\backend>git push -f heroku master
Enumerating objects: 16, done.
Counting objects: 100% (16/16), done.
Delta compression using up to 4 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (10/10), 956 bytes | 956.00 KiB/s, done.
Total 10 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/nodejs
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz
remote:
remote: ! ERROR: Application not supported by 'heroku/nodejs' buildpack
remote: !
remote: ! The 'heroku/nodejs' buildpack is set on this application, but was
remote: ! unable to detect a Node.js codebase.
remote: ! A Node.js app on Heroku requires a 'package.json' at the root of
remote: ! the directory structure.
remote: !
remote: ! If you are trying to deploy a Node.js application, ensure that this
remote: ! file is present at the top level directory. This directory has the
remote: ! following files:
remote: !
remote: ! backend/
remote: ! ui/
remote: !
remote: ! If you are trying to deploy an application written in another
remote: ! language, you need to change the list of buildpacks set on your
remote: ! Heroku app using the 'heroku buildpacks' command.
remote: !
remote: ! For more information, refer to the following documentation:
remote: ! https://devcenter.heroku.com/articles/buildpacks
remote: ! https://devcenter.heroku.com/articles/nodejs-support#activation
remote:
remote:
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to ins-app-clone.
remote:
To https://git.heroku.com/ins-app-clone.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ins-app-clone.git'
Heroku buildpack looks at the top-level (root) for package.json.
The solution here is to use git sub-trees. I too was facing this issue where I had a Monorepo MERN codebase in which I wanted to deploy my server using Heroku and client via Vercel.
I have written a blog post regarding this, I'm sure you'll get an idea regarding a solution to this.
Link to Blog Post
I have this repo that i forked from an other one that is suppose to work just plug and play. Yet when i deploy it, it returns application error. I've already solved all npm vulnerabilities.
The bulid log is as follows
-----> 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): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 12.x...
Downloading and installing node 12.18.4...
Using default npm version: 6.14.6
-----> Restoring cache
- node_modules is checked into source control and cannot be cached
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
express-handlebars#3.1.0 /tmp/build_514cee29_/node_modules/express-handlebars
glob#7.1.4 /tmp/build_514cee29_/node_modules/glob
fs.realpath#1.0.0 /tmp/build_514cee29_/node_modules/fs.realpath
inflight#1.0.6 /tmp/build_514cee29_/node_modules/inflight
once#1.4.0 /tmp/build_514cee29_/node_modules/once
wrappy#1.0.2 /tmp/build_514cee29_/node_modules/wrappy
inherits#2.0.4 /tmp/build_514cee29_/node_modules/inherits
minimatch#3.0.4 /tmp/build_514cee29_/node_modules/minimatch
brace-expansion#1.1.11 /tmp/build_514cee29_/node_modules/brace-expansion
balanced-match#1.0.0 /tmp/build_514cee29_/node_modules/balanced-match
concat-map#0.0.1 /tmp/build_514cee29_/node_modules/concat-map
path-is-absolute#1.0.1 /tmp/build_514cee29_/node_modules/path-is-absolute
graceful-fs#4.2.2 /tmp/build_514cee29_/node_modules/graceful-fs
handlebars#4.7.6 /tmp/build_514cee29_/node_modules/handlebars
minimist#1.2.5 /tmp/build_514cee29_/node_modules/minimist
neo-async#2.6.2 /tmp/build_514cee29_/node_modules/neo-async
source-map#0.6.1 /tmp/build_514cee29_/node_modules/source-map
wordwrap#1.0.0 /tmp/build_514cee29_/node_modules/wordwrap
object.assign#4.1.0 /tmp/build_514cee29_/node_modules/object.assign
define-properties#1.1.3 /tmp/build_514cee29_/node_modules/define-properties
object-keys#1.1.1 /tmp/build_514cee29_/node_modules/object-keys
function-bind#1.1.1 /tmp/build_514cee29_/node_modules/function-bind
has-symbols#1.0.0 /tmp/build_514cee29_/node_modules/has-symbols
promise#8.0.3 /tmp/build_514cee29_/node_modules/promise
asap#2.0.6 /tmp/build_514cee29_/node_modules/asap
accepts#1.3.7 /tmp/build_514cee29_/node_modules/accepts
mime-types#2.1.27 /tmp/build_514cee29_/node_modules/mime-types
mime-db#1.44.0 /tmp/build_514cee29_/node_modules/mime-db
negotiator#0.6.2 /tmp/build_514cee29_/node_modules/negotiator
array-flatten#1.1.1 /tmp/build_514cee29_/node_modules/array-flatten
body-parser#1.19.0 /tmp/build_514cee29_/node_modules/body-parser
bytes#3.1.0 /tmp/build_514cee29_/node_modules/bytes
content-type#1.0.4 /tmp/build_514cee29_/node_modules/content-type
debug#2.6.9 /tmp/build_514cee29_/node_modules/debug
ms#2.0.0 /tmp/build_514cee29_/node_modules/ms
depd#1.1.2 /tmp/build_514cee29_/node_modules/depd
http-errors#1.7.2 /tmp/build_514cee29_/node_modules/http-errors
inherits#2.0.3 /tmp/build_514cee29_/node_modules/http-errors/node_modules/inherits
setprototypeof#1.1.1 /tmp/build_514cee29_/node_modules/setprototypeof
statuses#1.5.0 /tmp/build_514cee29_/node_modules/statuses
toidentifier#1.0.0 /tmp/build_514cee29_/node_modules/toidentifier
iconv-lite#0.4.24 /tmp/build_514cee29_/node_modules/iconv-lite
safer-buffer#2.1.2 /tmp/build_514cee29_/node_modules/safer-buffer
on-finished#2.3.0 /tmp/build_514cee29_/node_modules/on-finished
ee-first#1.1.1 /tmp/build_514cee29_/node_modules/ee-first
qs#6.7.0 /tmp/build_514cee29_/node_modules/qs
raw-body#2.4.0 /tmp/build_514cee29_/node_modules/raw-body
unpipe#1.0.0 /tmp/build_514cee29_/node_modules/unpipe
type-is#1.6.18 /tmp/build_514cee29_/node_modules/type-is
media-typer#0.3.0 /tmp/build_514cee29_/node_modules/media-typer
content-disposition#0.5.3 /tmp/build_514cee29_/node_modules/content-disposition
safe-buffer#5.1.2 /tmp/build_514cee29_/node_modules/safe-buffer
cookie#0.4.0 /tmp/build_514cee29_/node_modules/cookie
cookie-signature#1.0.6 /tmp/build_514cee29_/node_modules/cookie-signature
destroy#1.0.4 /tmp/build_514cee29_/node_modules/destroy
encodeurl#1.0.2 /tmp/build_514cee29_/node_modules/encodeurl
escape-html#1.0.3 /tmp/build_514cee29_/node_modules/escape-html
etag#1.8.1 /tmp/build_514cee29_/node_modules/etag
express#4.17.1 /tmp/build_514cee29_/node_modules/express
finalhandler#1.1.2 /tmp/build_514cee29_/node_modules/finalhandler
parseurl#1.3.3 /tmp/build_514cee29_/node_modules/parseurl
fresh#0.5.2 /tmp/build_514cee29_/node_modules/fresh
merge-descriptors#1.0.1 /tmp/build_514cee29_/node_modules/merge-descriptors
methods#1.1.2 /tmp/build_514cee29_/node_modules/methods
path-to-regexp#0.1.7 /tmp/build_514cee29_/node_modules/path-to-regexp
proxy-addr#2.0.6 /tmp/build_514cee29_/node_modules/proxy-addr
forwarded#0.1.2 /tmp/build_514cee29_/node_modules/forwarded
ipaddr.js#1.9.1 /tmp/build_514cee29_/node_modules/ipaddr.js
range-parser#1.2.1 /tmp/build_514cee29_/node_modules/range-parser
send#0.17.1 /tmp/build_514cee29_/node_modules/send
mime#1.6.0 /tmp/build_514cee29_/node_modules/mime
ms#2.1.1 /tmp/build_514cee29_/node_modules/send/node_modules/ms
serve-static#1.14.1 /tmp/build_514cee29_/node_modules/serve-static
utils-merge#1.0.1 /tmp/build_514cee29_/node_modules/utils-merge
vary#1.1.2 /tmp/build_514cee29_/node_modules/vary
uglify-js#3.11.1 /tmp/build_514cee29_/node_modules/uglify-js
Installing any new modules (package.json)
removed 50 packages and audited 26 packages in 0.974s
found 0 vulnerabilities
-----> Build
-----> Caching build
- node_modules
-----> Pruning devDependencies
audited 26 packages in 0.444s
found 0 vulnerabilities
-----> Build succeeded!
! This app may not specify any way to start a node process
https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type
-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 25.8M
-----> Launching...
Released v11
https://kbrus87-mp-commerce-nodejs.herokuapp.com/ deployed to Heroku
but when I go to the link it says application error.
My package.json is
{
"name": "mp-ecommerce-nodejs",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express-handlebars": "^3.1.0"
}
}
Any idea what is going on??
Your package.json doesn't have any npm start script, which Heroku needs in order to run your app. So if you have an .js file, e.g. app.js, you must add it to the package.json as shown below:
{
"name": "mp-ecommerce-nodejs",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"express-handlebars": "^3.1.0"
}
}
Browser Cant Display GULP SERVE SharePoint Workbench
I am trying to create a SharePoint 2016 web-part using Visual Studio CODE (version 1.22.2) and I've been struggling to get the dev environment to work in both Windows 7 and Windows Server 2012 R2 (exact same setup works fine on Windows 10). Right now, I'm focusing on the Windows Server 2012 environment, since I have a little more control there...
To give a bit of background:
* Windows 10 Machine: Personal machine I built myself, I am Administrator, all features work as expected.
* Windows Server 2012 R2: Work Machine, I have to live with what I have. I am a local administrator but cannot install anything... All of the existing apps were installed by administrators who used pre-packaged deployment tools. There are some (unknown) security restrictions in place (probably group policies) that may be causing problems.
* Windows 7: Work Machine, I have to live with what I have. I am now a local administrator but all of the existing apps were installed by someone else using pre-packaged deployment tools... There are some (unknown) security restrictions in place (probably group policies) that may be causing problems.
I had to fight just to get the environment to use the "yo #microsoft/sharepoint" command...
Then I had to fight just to get gulp to run (it was saying sp-build-web was not installed even though it was...)
Now I cannot get a browser to actually reach the gulp serve.
-Yes, I tried the "$env:NODE_NO_HTTP2=1" command.
-Yes I also used the "gulp trust-dev-cert" command
Internet Explorer 11 only shows:
This page can't be displayed
* Make sure the web address https://localhost:5432 is correct.
* Look for the page with your search engine.
* Refresh the page in a few minutes.
Chrome displays a similar error.
I've run out of ideas. I don't see any errors below I can continue to follow up on...
Can someone help please?
I have NodeJS v9.4.0 installed and the following npm packages:
PS C:\code\VSCode\amtdHeadlines_untethered> npm list -g --depth=0
C:\Users\UName\AppData\Roaming\npm
+-- #microsoft/generator-sharepoint#1.4.1
+-- #microsoft/sp-build-web#1.4.1
+-- #microsoft/sp-client-base#1.0.0
+-- #microsoft/sp-client-preview#1.4.1
+-- #microsoft/sp-core-library#1.4.1
+-- #microsoft/sp-module-interfaces#1.4.1
+-- #microsoft/sp-page-context#1.4.1
+-- #microsoft/sp-webpart-base#1.4.1
+-- #microsoft/sp-webpart-workbench#1.4.1
+-- #types/chai#4.1.3
+-- #types/mocha#5.2.0
+-- ajv#6.4.0
+-- ansi-regex#2.1.1
+-- balanced-match#1.0.0
+-- brace-expansion#1.1.11
+-- code-point-at#1.1.0
+-- compass#0.1.1
+-- concat-map#0.0.1
+-- console-control-strings#1.1.0
+-- express#4.16.3
+-- generator-aspnet#0.3.3
+-- generator-code#1.1.30
+-- generator-hottowel#0.6.1
+-- generator-webapp#3.0.1
+-- graceful-fs#4.1.11
+-- grunt#1.0.2
+-- gulp#4.0.0
+-- inherits#2.0.3
+-- is-fullwidth-code-point#1.0.0
+-- minimatch#3.0.4
+-- minimist#0.0.8
+-- minipass#2.2.4
+-- mkdirp#0.5.1
+-- mocha#5.1.1
+-- ncu#0.2.1
+-- npm#6.0.0
+-- npm-check-updates#2.14.2
+-- number-is-nan#1.0.1
+-- office-ui-fabric-js#1.5.0
+-- office-ui-fabric-react#5.94.0
+-- once#1.4.0
+-- react#16.3.2
+-- react-addons-update#15.6.2
+-- react-dom#16.3.2
+-- request#2.85.0
+-- safe-buffer#5.1.2
+-- string-width#1.0.2
+-- strip-ansi#3.0.1
+-- wrappy#1.0.2
+-- yallist#3.0.2
+-- yarn#1.6.0
`-- yo#2.0.2
PS C:\code\VSCode\amtdHeadlines_untethered> gulp serve
Build target: DEBUG
[17:34:15] Using gulpfile C:\code\VSCode\amtdHeadlines_untethered\gulpfile.js
[17:34:15] Starting gulp
[17:34:15] Starting 'serve'...
[17:34:15] Starting subtask 'pre-copy'...
[17:34:15] Finished subtask 'pre-copy' after 8.26 ms
[17:34:15] Starting subtask 'copy-static-assets'...
[17:34:15] Starting subtask 'sass'...
[17:34:16] Finished subtask 'sass' after 904 ms
[17:34:16] Starting subtask 'tslint'...
[17:34:16] Starting subtask 'typescript'...
[17:34:16] [typescript] TypeScript version: 2.2.2
[17:34:16] Finished subtask 'copy-static-assets' after 939 ms
[17:34:18] Finished subtask 'tslint' after 1.45 s
[17:34:18] Finished subtask 'typescript' after 1.45 s
[17:34:18] Starting subtask 'ts-npm-lint'...
[17:34:18] Finished subtask 'ts-npm-lint' after 8.62 ms
[17:34:18] Starting subtask 'api-extractor'...
[17:34:18] Finished subtask 'api-extractor' after 1.33 ms
[17:34:18] Starting subtask 'post-copy'...
[17:34:18] Finished subtask 'post-copy' after 700 μs
[17:34:18] Starting subtask 'collectLocalizedResources'...
[17:34:18] Finished subtask 'collectLocalizedResources' after 5.07 ms
[17:34:18] Starting subtask 'configure-webpack'...
[17:34:18] Finished subtask 'configure-webpack' after 504 ms
[17:34:18] Starting subtask 'webpack'...
(node:6804) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https
://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
[17:34:19] Finished subtask 'webpack' after 676 ms
[17:34:19] Starting subtask 'configure-webpack-external-bundling'...
[17:34:19] Finished subtask 'configure-webpack-external-bundling' after 1.14 ms
[17:34:19] Starting subtask 'copy-assets'...
[17:34:19] Finished subtask 'copy-assets' after 63 ms
[17:34:19] Starting subtask 'write-manifests'...
[17:34:19] Finished subtask 'write-manifests' after 407 ms
[17:34:19] Starting subtask 'serve'...
Starting api server on port 5432.
Registring api: /getwebparts
Registring api: /.
Registring api: /workbench
[17:34:20] Finished subtask 'serve' after 483 ms
[17:34:20] Finished 'serve' after 4.61 s
(node:6804) ExperimentalWarning: The http2 module is an experimental API.
[17:34:20] Server started https://localhost:4321
[17:34:20] LiveReload started on port 35729
[17:34:20] Opening https://localhost:5432/workbench using the default OS app
Request: [::1] '/workbench'
[17:34:20] ==================[ Finished ]==================
[17:34:21] Project amtd-headlines-untethered version: 0.0.1
[17:34:21] Build tools version: 2.5.3
[17:34:21] Node version: v9.4.0
[17:34:21] Total duration: 7.79 s
Free the port 5432 since it is probably being used by another process.
Alternatively serve the application using a different config.
Go to 'config.serve.js' and change the port to your preferred port e.g. from '5432' to '8080' as follows:
{
"$schema": "https://developer.microsoft.com/json-schemas/core-
build/serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://localhost:8080/workbench",
"api": {
"port": 8080,
"entryPath": "node_modules/#microsoft/sp-webpart-workbench/lib/api/"
}
}
I'm getting the following error while trying to deploy mean stack application to heroku...
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
modules/camelcase
remote: Installing any new modules (package.json)
remote: removed 892 packages in 10.113s
remote:
remote: -----> Caching build
remote: Clearing previous node cache
remote: Saving 2 cacheDirectories (default):
remote: - node_modules
remote: - bower_components (nothing to cache)
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote: Done: 19.2M
remote: -----> Launching...
remote: Released v5
remote: https://rocky-coast-36852.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy.... done.
To https://git.heroku.com/rocky-coast-36852.git
142c119..1679a58 master -> master
Any kind of help is highly appreciated.
Here is my app.js file
//importing modules
var express=require('express');
var mongoose=require('mongoose');
var bodyparser=require('body-parser');
var cors=require('cors');
var path=require('path');
var app=express();
const route=require('./routes/route');
//connect to mongodb
mongoose.connect('mongodb://localhost:27017/contactlistapp');
//on connection
mongoose.connection.on('connected',()=>{
console.log('connected to mongodb #27107');
});
mongoose.connection.on('error',(err)=>{
if(err)
{
console.log('error in database connecton'+err);
}
});
//port number
const port=3000;
// adding middleware-cors
app.use(cors());
//body-parser
app.use(bodyparser.json());
//static files
app.use(express.static(path.join(__dirname,'public')));
//routes
app.use('/api',route);
//testing server
app.get('/',(req,res)=>{
res.send('foobar');
});
app.listen(port,()=>{
console.log('serve started at'+port);
});
Are any any other steps to be followed after git push heroku master?
When I push a default express app to heroku I get the following error. I've ensured I am up to date with heroku-toolbelt etc but it appears to be an error from the heroku side? Has anyone seen this? It pushes alright and works as expected but I suspect this could cause issues in the future.
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 404 bytes, done.
Total 4 (delta 1), reused 0 (delta 0)
-----> Heroku receiving push
-----> Node.js app detected
/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:425
return runInNewContext("(" + JSON.stringify(datum) + ")" + lookupCode);
^
TypeError: Cannot read property 'node' of undefined
at evalmachine.<anonymous>:1:118
at lookupDatum (/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:425:10)
at Socket.<anonymous> (/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:628:24)
at Socket.emit (events.js:61:17)
at Socket._onReadable (net.js:656:51)
at IOWatcher.onReadable [as callback] (net.js:177:10)
/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:425
return runInNewContext("(" + JSON.stringify(datum) + ")" + lookupCode);
^
TypeError: Cannot read property 'npm' of undefined
at evalmachine.<anonymous>:1:118
at lookupDatum (/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:425:10)
at Socket.<anonymous> (/app/slug-compiler/buildpacks/nodejs2/vendor/json/json:628:24)
at Socket.emit (events.js:61:17)
at Socket._onReadable (net.js:656:51)
at IOWatcher.onReadable [as callback] (net.js:177:10)
-----> Resolving engine versions
Using Node.js version: 0.4.7
Using npm version: 1.0.94
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
express#2.5.8 /tmp/build_1m5t2ah1oglfb/node_modules/express
connect#1.8.5 /tmp/build_1m5t2ah1oglfb/node_modules/express/node_modules/connect
qs#0.4.2 /tmp/build_1m5t2ah1oglfb/node_modules/express/node_modules/qs
mime#1.2.4 /tmp/build_1m5t2ah1oglfb/node_modules/express/node_modules/mime
formidable#1.0.9 /tmp/build_1m5t2ah1oglfb/node_modules/express/node_modules/connect/node_modules/formidable
mkdirp#0.3.0 /tmp/build_1m5t2ah1oglfb/node_modules/express/node_modules/mkdirp
jade#0.20.3 /tmp/build_1m5t2ah1oglfb/node_modules/jade
commander#0.5.2 /tmp/build_1m5t2ah1oglfb/node_modules/jade/node_modules/commander
mkdirp#0.3.0 /tmp/build_1m5t2ah1oglfb/node_modules/jade/node_modules/mkdirp
Dependencies installed
-----> Discovering process types
Procfile declares types -> web
-----> Compiled slug size is 3.1MB
-----> Launching... done, v7
This was a heroku issue and appears to have gone away.
I'm going to go out on a limb here and say that it has something to do with parsing your package.json. Take a look at Specifying a version of Node.js/npm. Is everything valid JSON?
My guess is that this evalmachine is evaluating your package.json in a sandbox environment (see vm.runInNewContext), and lookupCode is some way of, first, checking engines.node, then engines.npm. Are both of these accessible? If this is the truth, then shame on Heroku's Devs for not expecting this error and accounting for it with some useful message. They're usually good about such things.