I have a file that works in local enviroment perfectly fine. But when i deploy it to Heroku it gets a build Error. The Heroku logs show me that it cannot find module request. I also took attention that the package.json is configured right:
Package.json:
{
"name": "nodejs - express - server",
"version": "1.0.0",
"description": "",
"main": "proxy-request.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node proxy-request.js"
},
"keywords": [
"example",
"heroku"
],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.16.3",
"request": "^2.87.0"
},
"engines": {
"node": "8.11.2"
}
}
And these are the packages i use in my proxy-request.js file:
const request = require('request');
const http = require('http');
const url = require('url');