My project has an .npmrc located in its root, which contains the infamous ${NPM_TOKEN} hack and is required for CI, Staging, Production, etc. In order to work around this reality, I’d like for developers to be able to tell npm to use an alternative .npmrc, which contains their _authToken, when installing dependencies. Something like, npm install . –npmrc=~/.npmrc. This would
Tag: heroku
Defining an array as an environment variable in node.js
I have an array that I pull data from. Since I’m using heroku, it may be better to replace it with an environment variable, but I’m not sure how to do that. Is using a JSON string as an environment variable the way to go? Answer In this scenario, it doesn’t sound like an env var is the way to
Heroku + Node: Cannot find module error
My Node app is running fine locally, but has run into an error when deploying to Heroku. The app uses Sequelize in a /models folder, which contains index.js, Company.js and Users.js. Locally, I am able to import the models using the following code in /models/index.js: This works fine, however, when I deploy to Heroku the app crashes with the following