Coder Social home page Coder Social logo

install on Heroku fails about node-neo4j HOT 23 CLOSED

thingdom avatar thingdom commented on July 26, 2024
install on Heroku fails

from node-neo4j.

Comments (23)

aseemk avatar aseemk commented on July 26, 2024

This was quite tricky, but I realize what's going on!

> [email protected] postinstall /tmp/build_20zj9urr4tkew/node_modules/neo4j
> npm run build

sh: npm: not found

Heroku doesn't come with npm available to npm scripts. Very strange this way. We use npm in multiple ways during our top-level app's install scripts, so we had worked around this by simply adding npm as a dependency itself.

This lib should absolutely work on Heroku without workarounds, so I'll fix this. In the meantime, would you be able to simply add npm as a dependency to your project?

I'll also bug Heroku to ask why npm isn't available. Thanks for reporting!

from node-neo4j.

ethul avatar ethul commented on July 26, 2024

Great! Your suggestion worked like a charm.

Thanks,
-Eric

from node-neo4j.

aseemk avatar aseemk commented on July 26, 2024

Hey @ethul, this seems to be fixed for me. Can you test it from your app too? (By removing the explicit npm dependency and redeploying.) Thanks!

from node-neo4j.

ethul avatar ethul commented on July 26, 2024

Thanks @aseemk I will test this on my next deploy and report back.

from node-neo4j.

ethul avatar ethul commented on July 26, 2024

Hi @aseemk, I just ran a deploy and still see the error.

from node-neo4j.

aseemk avatar aseemk commented on July 26, 2024

Thanks for testing @ethul! Okay, I'll continue working with Heroku to fix this.

from node-neo4j.

ethul avatar ethul commented on July 26, 2024

Welcome @aseemk, keep me posted. I am happy to re-test.

from node-neo4j.

athieriot avatar athieriot commented on July 26, 2024

Hi everyone,

I encounter exactly the same error on Heroku with the version 0.2.19 or node-neo4j

  sh: npm: not found
  npm ERR! [email protected] postinstall: `npm run build`
  npm ERR! `sh "-c" "npm run build"` failed with 127

Any news?

Thank you very much

from node-neo4j.

aseemk avatar aseemk commented on July 26, 2024

Sorry @athieriot, I haven't made time to do this yet. You're aware of the workaround mentioned above, of simply adding npm as a dependency in your package.json, yes?

from node-neo4j.

athieriot avatar athieriot commented on July 26, 2024

Yeah the temporary fix is working anyway :) Thank you.

After looking around, though, I think it should be fix in the corresponding Heroku buildpack.
There is a reported issue and a pending Pull Request on the project.

Let's see how that goes.

from node-neo4j.

aseemk avatar aseemk commented on July 26, 2024

Yes, it's indeed Heroku's Node.js buildpack that should be fixed. Great to hear the workaround works for now!

from node-neo4j.

flipside avatar flipside commented on July 26, 2024

Personally, I think precompiling the javascript in the next version submitted to npm and removing the build command would be simplest.

from node-neo4j.

athieriot avatar athieriot commented on July 26, 2024

Hi !

Just to warn you that it seems the workaround is not working anymore with Node.js 0.10.x

from node-neo4j.

aseemk avatar aseemk commented on July 26, 2024

Sorry for the delay in responding, @athieriot, but yes, you're right! Looking into this now.

@flipside: you might be right. =)

from node-neo4j.

aseemk avatar aseemk commented on July 26, 2024

Okay, fixed as @flipside recommended; installation of this library now works on Heroku out-of-the-box even with Node 0.10. Thanks for the heads-up @athieriot!

from node-neo4j.

athieriot avatar athieriot commented on July 26, 2024

Really great!

Thank you

from node-neo4j.

aseemk avatar aseemk commented on July 26, 2024

No prob at all.

Forgot to mention: this pre-compiled version is published on npm as 0.2.20 now, so be sure to update your package.json and/or npm-shrinkwrap.json if you need to.

from node-neo4j.

zishon89us avatar zishon89us commented on July 26, 2024

@aseemk problem still continues on heroku;
I just tried it one machine with 0.2.20 and included npm as dependency then it worked

from node-neo4j.

aseemk avatar aseemk commented on July 26, 2024

Very strange @zishon89us. You shouldn't have had to do that, but it's good that at least it's working for now. If you're still interested in figuring out the issue, let me know. Otherwise, let me know if it stops working again.

from node-neo4j.

zishon89us avatar zishon89us commented on July 26, 2024

@aseemk I would try it on other machine, will update you soon.

from node-neo4j.

sonoman avatar sonoman commented on July 26, 2024

Hi there:
I'm having the same problem, only that in my case, I'm trying to execute a "preinstall" script, calling "npm install ./src/" to build a package that's below my package root....so i don't know how could i add npm as dependency......

npm install ./src/
sh: npm: not found
npm ERR! [email protected] preinstall: npm install ./src/

Any help will be very much appreciated

from node-neo4j.

aseemk avatar aseemk commented on July 26, 2024

@sonoman: you're having the same problem, meaning node-neo4j won't install on Heroku for you?

Or do you mean you're seeing a similar error unrelated to node-neo4j? The error sh: npm not found refers to the fact that npm isn't installed globally on Heroku at build-time. So adding it as a dependency means adding it to your package.json. E.g.:

"dependencies": {
    "npm": "1.x"
}

from node-neo4j.

sonoman avatar sonoman commented on July 26, 2024

that's the case (I'm doing something similar and getting the same problem).
Thanks for the suggestion, it worked fine ;)

On Mon, May 6, 2013 at 4:39 PM, Aseem Kishore [email protected]:

@sonoman https://github.com/sonoman: you're having the same problem,
meaning node-neo4j won't install on Heroku for you?

Or do you mean you're seeing a similar error unrelated to node-neo4j? The
error sh: npm not found refers to the fact that npm isn't installed
globally on Heroku at build-time. So adding it as a dependency means adding
it to your package.json. E.g.:

"dependencies": {
"npm": "1.x"}


Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-17503100
.

from node-neo4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.