Fail to deploy node.js application to heroku

后端 未结 5 1587
感动是毒
感动是毒 2020-12-10 03:52

I am trying to deploy a simple node.js express-based application to heroku, something which is apparently very basic: https://devcenter.heroku.com/articles/nodejs

He

5条回答
  •  遥遥无期
    2020-12-10 04:35

    Heroku team, could you please consider configuring npm to use npm install --no-bin-links --production by default, or creating an environment variable to let users set that flag. This is a serious bug in node installs. Removing the bin directory from my .gitignore (as suggested below) enabled me to deploy, but it breaks using git effectively in a cross-platform development environment, requiring an explicit npm rebuild on every git pull where node_modules might have changed.

    NPM best practice is to avoid having node_modules in .gitignore (see http://www.futurealoof.com/posts/nodemodules-in-git.html ).

    I believe --no-bin-links will provide the best of both worlds, enabling deploys of node_modules where the bin directory has been excluded, supporting npm rebuild, but not failing when a bin link is created.

    I submitted a pull request here: https://github.com/heroku/heroku-buildpack-nodejs/pull/33

    Thanks!

提交回复
热议问题