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: 
It’s because Heroku thinks you are deploying a Node app. But what you are deploying is **the `public` directory** of a Node app, not Node code.

Heroku uses buildpacks to select how the ap is handled. You want to clear that Node association:

`buildpacks:clear # clear all buildpacks set on the app`

Which means that “Next release will detect buildpack normally.”, that should solve it for you.

ref: <https://devcenter.heroku.com/articles/buildpacks>
Most apps have at least one of these signatures present, so if you see this error, it usually means an important file isn't checked into your git repository:

* Java: pom.xml
* Ruby: Gemfile
* Node.js: package.json
* Python: requirements.txt / setup.py / Pipfile
* PHP: composer.json / index.php

You should:

```
git add {file}
git commit -am 'added {file} 
git push heroku master

```