socket.io + node.js on heroku

前端 未结 6 1257
后悔当初
后悔当初 2021-01-03 06:55

I\'m having some issues in compiling a socket.io app on heroku.

Thats the app.js file

var app = require(\'express\').createServer()
   , io = require         


        
6条回答
  •  南方客
    南方客 (楼主)
    2021-01-03 07:51

    When you run npm install locally, hiredis creates some files with paths that are specific to your machine. When you push these cached dependencies to Heroku, the build fails.

    Waf: Entering directory `/Users/gaggina/Desktop/socket2/node_modules/socket.io/node_modules/redis/node_modules/hiredis/build'
    

    You can get around this problem by removing the node_modules/hiredis directory from source control, letting Heroku compile it anew:

    git rm -rf node_modules/hiredis
    rm -rf node_modules/hiredis
    echo "node_modules/hiredis" >> .gitignore
    

提交回复
热议问题