2013-03-17 110 views
2

第一個Node應用程序部署已經跟着聖誕教程12devs創建我的第一個Node.js的應用程序(http://12devsofxmas.co.uk/post/2012-12-28-day-3-realtime-collaborative-drawing-with-nodejs)現在我試圖跟隨羅布多德森的教程通過的Heroku(http://robdodson.me/blog/2012/06/04/deploying-your-first-node-dot-js-and-socket-dot-io-app-to-heroku/麻煩通過Heroku的

進行部署

然而,承諾github上,之後當我嘗試推到Heroku的,我碰到下面的錯誤輸出:

-----> Installing dependencies with npm 
     npm WARN package.json [email protected] No README.md file found! 
     npm http GET https://registry.npmjs.org/express 
     npm http 200 https://registry.npmjs.org/express 
     npm http GET https://registry.npmjs.org/express/-/express-2.5.11.tgz 
     npm http 200 https://registry.npmjs.org/express/-/express-2.5.11.tgz 
     npm ERR! Refusing to delete: /tmp/build_1t6d7hbd2psal/node_modules/.bin/express not in /tmp/build_1t6d7hbd2psal/node_modules/express 
     File exists: /tmp/build_1t6d7hbd2psal/node_modules/.bin/express 
     Move it away, and try again. 

     npm ERR! System Linux 2.6.32-350-ec2 
     npm ERR! command "/tmp/node-node-Fenl/bin/node" "/tmp/node-npm-6pyT/cli.js" "install" "--production" 
     npm ERR! cwd /tmp/build_1t6d7hbd2psal 
     npm ERR! node -v v0.6.20 
     npm ERR! npm -v 1.1.65 
     npm ERR! path /tmp/build_1t6d7hbd2psal/node_modules/.bin/express 
     npm ERR! code EEXIST 
     npm ERR! 
     npm ERR! Additional logging details can be found in: 
     npm ERR!  /tmp/build_1t6d7hbd2psal/npm-debug.log 
     npm ERR! not ok code undefined 
     npm ERR! not ok code 1 
!  Failed to install --production dependencies with npm 

!  Heroku push rejected, failed to compile Node.js app 

To [email protected]:secure-dawn-2437.git 

! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:secure-dawn-2437.git' 

我的package.json文件如下:

{ 
    "name": "Draw", 
    "version": "0.0.1", 
    "private": true, 
    "dependencies": { 
     "express": "~2.x", 
     "socket.io": "~0.9.x" 
    }, 
    "engines": { 
     "node": "0.6.x", 
     "npm": "1.1.x" 
    } 
} 

對不起 - 我完全陌生的這種發展,已經在Java中大部分的工作,而在學校,但我渴望學習。我認爲問題是某種方式表達,但我不知道這是什麼意思是「將其移開,然後再試一次。」

回答

0

我能夠通過暫時禁用Heroku的使用緩存來解決這個問題:

heroku config:set NODE_MODULES_CACHE=false

推動構建,然後打開緩存重新打開。