Heroku "npm install jugglingdb mongoose" Already did - node.js

I am trying Heroku, but i have run into a problem.
I deployed the Node.js app, but it crashed, I then tested it localy and find out that it was because it did not have run the command "npm install jugglingdb mongoose".
I did that and then it worked locally, then i tried
git add .
and
git commit -m 'db'
but then I get the message:
nothing to commit (working directory clean)
Then I think, "Okay, then i try to commit that to heroku, now it works on my local computer"
git push heroku master
But i just get
Everything up-to-date
Then i try restarting it and try my app again
heroku restart
But the logs says again = npm install jugglingdb mongoose
What could be the problem? I have also tried npm update and it did not update anything.

Ensure that your 'node_modules' directory isn't empty and your modules are installed inside your local project instead of the default NPM root:
npm update --binroot

Related

Node js Application- Getting 'command not found' after connecting project to github

I made a node js application and I was using nodemon to restart the server whenever I made changes, I made a repository on github and connected my node project. Now I can't run nodemon because it says command not found. I'm not sure about how to fix it.
install nodeman globally and try again,
hopes you do have configuration file and package.json
npm install nodeman -g

Node.js- Can't get React browser to open when I run 'npm run start' or MongoDB to start when I run 'mongod'

I've been having issues with a project I'm working on. I couldn't push or pull code from Git because of merge conflicts which I couldn't find them all so I thought it would be easier to just clone the latest commit from the repo and manually put my code in but when I cloned it I have an error when I run 'npm start' to start the react browser, it doesn't open and webpack doesn't come up and also when I run 'mongod' I get an error about it already possibly running an instance but nothing else is running and even when I kill it and re-run it I get the same error.
I just ran 'git stash' and 'git reset --hard HEAD' and had the response 'HEAD is now at 32c5fb3 visual changed' but when I try to run 'npm run start' the react browser doesn't start and 'mongod' still doesn't run.
I'm trying to get the latest commit to the repo to work with react-router and mongodb.
This error is after I deleted the node_modules folder and ran 'npm i' in the root,
Then went into the 'client' directory and ran 'npm run start' to start React
It looks like your node modules are not completely installed. Try deleting node modules again and run npm install

Meteor npm start not working (Rocket.Chat)

I just cloned Rocket.Chat code and remove the .git from cloned code and init my git and pushed in my repository. But when I am trying to clone it somewhere else from my repository and trying to start the Rocket.Chat, it is giving following error. I am using latest versions of node and npm. Please help.
I found the issue. In current Rocket.Chat ".gitignore" file they put "build.sh" in ignore file list. And when we remove their git and add our git then the same named file on path "Rocket.Chat/packages/rocketchat-livechat/plugin" get ignored from commit. And Rocket.Chat is using that file when we run the "meteor npm start".
Try to run meteor npm install before running with meteor run.

'npm EER! code 1' When installing dependencies using `npm install --production`

I am using flightplan to deploy my node.js application to my server. I run the command fly production in my CLI to deploy my app to the server. It does rsync fine, but when it comes to installing dependencies, I get the following error:
I made sure that I have sudo privileges on my server for this user and npm is definitely installed as it gives the version number when I run the command npm -von my server. I have tried to run npm install --production myself on the server as the deploy script does and I get the same error, meaning it is something to do with installing dependencies. Potentially, it could be because in my flightplan.js, when it runs the command git ls-files to get the files to copy across. it includes all the node_modules even though i've made sure that node_modules is in the .gitingore file.
Does anyone have experience with flightplan npm module/or know why my npm install isn't working on my server?
(I edited out my server IP address from the picture)
Thanks in advance!
I found that if I removed the node_modules folder by running command rm -rf node_modules/ then committed this to github, then re-ran npm install and then my call to fly production worked successfully.

Skip "Installing dependencies with npm" step when pushing a Node.js app to Heroku

Running git push heroku master always triggers a step that prompts:
Installing dependencies with npm
This step loads and reinstalls all of the dependencies again even it already exists. This is very time consuming and I want to skip this step sometimes when I deploy that I know the dependencies are the same.
Is there any command or options that do this?
Its been a long time since you asked this question, now the Heroku buildpack caches node_modules, so install times will be much faster.
If however you still want to block npm install, here is one solution.
As of when I write this, the default Heroku build pack does not allow skipping npm install entirely. You can see in the dependencies.sh file, this line will always run:
npm install --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
However, if you create a file called .npmrc in your project folder with the following contents:
dry-run
This will cause npm install to not modify your existing node_modules directory.
Note that this change will also apply to the npm prune command that Heroku runs, but WILL NOT apply to the npm rebuild command (which is probably fine).
try to remove
node_modules
for example
from you .gitignore
Simplest ways I've found are
heroku apps:rename newTemporaryName
then
heroku apps:rename originalName
or change the NODE_ENV and get it back to previous again.
heroku config:set NODE_ENV=dev
then
heroku config:set NODE_ENV=production
There are probably other, similar hacks but these should be sufficient.

Resources