Question: I git cloned a Node.js application (the version specified in the `package.json` being `4.1.2` and that of my local machine being `6.2.2`) and tried to git push on Heroku. But it failed to build and gave this error:

> 
> Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz
> 
> 
> 

Now I set the buildpack to heroku/nodejs and I get this message:

```
Buildpack set. Next release on lit-badlands-92088 will use heroku/nodejs.
Run git push heroku master to create a new release using this buildpack.

```

Now when I run `git push heroku master`, I am again told:

```
remote: -----> Failed to detect set buildpack
        https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz  

remote: More info: 
https://devcenter.heroku.com/articles/buildpacks#detection-failure  

remote:  
remote:  !     Push failed  
remote: Verifying deploy...  
remote:  
remote: !       Push rejected to lit-badlands-92088.

```

What could be the possible reasons for the Node.js buildpack not being detected even if I set it?

Answer: 
I had similar issue, here are the steps which solved the problem.

```
heroku buildpacks:set heroku/nodejs
git push heroku master

```

Basically details are in the more info link - 

---

This situation may also occur if you remove or rename a file that previously led to the automatic detection of your application type and thus the automatic setting of the detected buildpack on your application.

---
I run into the same issue and tried everything, eventually realized no file would commit because they were already committed and pushed to the github repository.
So you need to do the following:

* Remove old git. folder:

> 
> rm -rf .git
> 
> 
> 

* Create new git:

> 
> git init
> 
> 
> 

* Add all project files:

> 
> git add .
> 
> 
> 

* Commit:

> 
> git commit -m “commit name”
> 
> 
> 

* Creat new heroku application:

> 
> heroku create
> 
> 
> 

* Push code to master:

> 
> git push heroku master
> 
> 
> 

This worked for me.