I keep getting “Application Error” when I run my Heroku app for the timestamp service.
The only thing that keeps popping up in the Heorku log is “NPM_CONFIG_LOGLEVEL=error” (entire latest log is appended to the bottom of this missive)
At first I thought Heroku was choking on the port, so I fixed that and still got the error.
After continued reading, I have come to think there is something not quite right with the json package. But after several updates, I am still getting the same darn error.
Any suggestions, fellow campers?
-----> Node.js app detected
-----> Creating runtime environment
-----> Installing binaries
engines.node (package.json): 4.6.1
engines.npm (package.json): unspecified (use default)
Downloading and installing node 4.6.1...
Using default npm version: 2.15.9
-----> Restoring cache
Loading 2 from cacheDirectories (default):
- node_modules (not cached - skipping)
- bower_components (not cached - skipping)
-----> Building dependencies
Installing node modules (package.json)
-----> Caching build
Clearing previous node cache
Saving 2 cacheDirectories (default):
- node_modules (nothing to cache)
- bower_components (nothing to cache)
-----> Build succeeded!
-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> web
https://timestampapiforfcc.herokuapp.com/ deployed to Heroku
package.json is missing dependencies.
var express = require ('express');
var moment = require('moment');
You are requiring
moment, but they are not in
Thank you for your reply, but I am confused. Those are both already in the code. If they are also supposed to be in the json package, what you have shown me is not json format.
When you upload your project to Heroku, it goes through
package.json file and install all necessary dependencies listed in that file. Your
package.json doesn’t have any.
What I showed you is the part of your code where you require external dependencies, not included in node.js. You must include them as dependencies in
How did you get
moment on your computer?
I did not put them on my actual computer, if I am understanding how c9 works. Rather, from the c9 terminal I did $npm install express and $ npm install moment
Just updated my json package and am still getting the same error, "NPM_CONFIG_LOGLEVEL=error"
but the HEROKU APP IS NOW WORKING!!!
“description”: “this is the timestamp challenge for FCC”,
“start”: “node server.js”
“author”: “john gillespie”,
Why do you think this is error? To me it seems that log level is set to show only errors.
Ah, I saw “=error” and thought it was telling me there was some kind of error. Thank you again for your assistance with this!