2013-02-07 10 views
1

현재 앱을 Heroku에 푸시하려고합니다. 이미 몇 번 배포 할 수 있었지만 지금은 packages.json 파일에서 "> = 3.5.0"에서 "> = 3.6.0rc0"으로 mongoose를 업데이트했습니다. 그러나 버전 3.6에서는 mpath 및 mpromise가 필요합니다.Heroku에 Node.JS 앱 배포 - 캐싱 문제가 있습니까?

슬러그 컴파일이 시작되면 내 응용 프로그램이 시작될 때 캐시 된 버젼의 몽구스를 사용하며 "오류 : 모듈 'mpath'를 찾을 수 없습니다."가 표시됩니다.

내가 설정에 캐싱을 중지 할 사용자 정의 buildpack의 힘내려고, 난 그냥 사용할 수 여기에, 빈/컴파일에서 캐시 물건을 주석 : http://pastebin.com/L3Yqy2NR

: 여기

https://github.com/jValdron/heroku-buildpack-nodejs 푸시의 출력

또한, 'heroku run bash'로 로그인하면 package.json에서 일부 종속성을 제거 할 때 node_modules에서 제거 된 종속성을 확인할 수 있습니다. 나는 이미 node_modules 폴더를 제거하고 또 다른 'git push'를 시도했다. 삭제 된 deps는 여전히 node_modules에 있습니다.

누구든지이 문제를 해결하는 방법에 대한 아이디어가 있습니까?

편집 :

가 여기 내 package.json 파일입니다 : 이전에 말했듯이

{ 
    "name": "souply-api", 
    "version": "0.1.0", 
    "author": "Jason Valdron <[email protected]>", 
    "description": "Main gears that runs the Soup.ly application", 
    "dependencies": { 
     "bcrypt": ">= 0.7.3", 
     "express": ">= 3.0.5", 
     "extend": ">= 1.1.3", 
     "imagemagick": ">= 0.1.3", 
     "jade": ">= 0.27.7", 
     "knox": ">= 0.4.6", 
     "less": ">= 1.3.1", 
     "less-middleware": ">= 0.1.9", 
     "moment": ">= 1.7.2", 
     "mongoose": ">= 3.6.0rc0", 
     "mongoose-types": ">= 1.0.3", 
     "node-native-zip": ">= 1.1.0", 
     "nodemailer": ">= 0.3.37", 
     "oauth2orize": ">= 0.1.0", 
     "passport": ">= 0.1.15", 
     "passport-local": ">= 0.1.6", 
     "passport-google": ">= 0.2.0", 
     "passport-facebook": ">= 0.1.4", 
     "passport-twitter": ">= 0.1.4", 
     "passport-http": ">= 0.2.1", 
     "passport-http-bearer": ">= 0.2.0", 
     "passport-oauth2-client-password": ">= 0.1.0", 
     "poor-form": ">= 1.1.3", 
     "request": ">= 2.12.0", 
     "socket.io": ">= 0.9.13" 
    }, 
    "engines": { 
     "node": "0.8.x", 
     "npm": "1.1.x" 
    } 
} 

몽구스가, 3.6.0rc로 설정됩니다. Mpath는 Mongoose의 package.json 파일에 종속되어 있습니다. 내가 heroku run bash로 로그인하는 경우, 또한

"dependencies": { 
    "hooks": "0.2.1" 
    , "mongodb": "1.2.11" 
    , "ms": "0.1.0" 
    , "sliced": "0.0.3" 
    , "muri": "0.3.0" 
    , "mpromise": "0.2.0" 
    , "mpath": "0.1.1" 
} 

를, 나는 여기서, mpath 및 mpromise이없는 것을 볼 node_modules/mongoose/node_modules로 이동 : 내 지역 몽구스 package.json 파일을 보면,이를 볼 수 있습니다.

답변

4

node_modules는 Git repo에있었습니다. 레포에서 제거하여 정상적으로 작동했습니다. node_modules에 대한

+0

당신은이 대답을 받아 들여야 만합니다. :) – streetlight

+1

@streetlight 아, 고맙다. 대답했다. 내 대답을 받아들이려면 몇 시간을 기다려야했다. 그리고 나는 그것에 대해 잊어 버렸다. :) – jValdron

+0

문제 없음 - 우리 중 최고 일이 생겼어. – streetlight

0
당신이

수 (몽구스 항목 전에) 당신은 또한 당신의 package.json에있는 mpath을 추가 당신이 필요합니다

를 사용하는 몽구스의 최신 버전으로 당신의 package.json을 업데이트해야합니다

package.json 파일을 게시 하시겠습니까?

+0

내 편집을 참조하십시오. 나는 이미 mpath와 mpromise (3.6.0rc0에 대한 2 개의 새로운 deps)를 포함하려고했지만, 그 중 하나가 작동하지 않는 것 같습니다. – jValdron

2

자에게 Heroku가 비활성화 지원 캐시 : node_modules의 https://devcenter.heroku.com/articles/nodejs-support#cache-behavior

Heroku maintains a cache directory that is persisted between builds. This cache is used to store caches for npm, yarn, and bower. You can disable all caching for Node.js apps if you prefer:

heroku config:set NODE_MODULES_CACHE=false git commit -am 'disable node_modules cache' --allow-empty git push heroku master

0

제거 캐시 및 다시 배포 :

git rm -r --cached node_modules 

하고 또한 할 수있는 다음 git push heroku master

을 dis 다시 배포하는 동안 캐시 node_module을 원하지 않으면 캐시를 사용할 수 있습니다.

heroku config:set NODEMODULESCACHE=false 
git commit -am 'rebuild' --allow-empty 
git push heroku master 
heroku config:unset NODEMODULESCACHE 
0

package.json의 노드 버전을 변경하면 저에게 해 주셨습니다.예를 들어

:

"engines": { 
    "node": "9.2.1" 
}