简体   繁体   English

带有Strongloop buildpack的Heroku NPM版本

[英]Heroku npm version with Strongloop buildpack

So I have a project built on top of loopback.io. 所以我有一个基于loopback.io的项目。 I have specified the node and npm versions within package.json. 我已经在package.json中指定了节点和npm版本。 However, for some odd reasons upon installation the server still seems to be using npm = 1.4.28. 但是,由于某些奇怪的原因,安装后服务器似乎仍在使用npm = 1.4.28。 Thoughts on what else I need to do? 关于我还需要做什么的想法? Right now I am assuming because of npm = 1.4.28, it is causing issue for lodash to install. 现在我假设由于npm = 1.4.28,这导致lodash安装出现问题。

I did the usual for building Strongloop on heroku: heroku apps:create --buildpack https://github.com/strongloop/strongloop-buildpacks.git 我做了在Heroku上构建Strongloop的常规操作:heroku apps:create --buildpack https://github.com/strongloop/strongloop-buildpacks.git

"engines": {
    "node": "0.10.x",
    "npm": "2.x"
}

And the log from heroku upon git push 和来自git push的heroku的日志

remote:        
remote:        npm ERR! EEXIST, open '/app/.npm/ea4720da-app-npm-lodash-2-4-1-package-tgz.lock'
remote:        File exists: /app/.npm/ea4720da-app-npm-lodash-2-4-1-package-tgz.lock
remote:        Move it away, and try again. 
remote:        
remote:        npm ERR! System Linux 3.13.0-40-generic
remote:        npm ERR! command "/tmp/build_bf55002725acbaa28a6caabb58f75a77/vendor/node/bin/node" "/tmp/build_bf55002725acbaa28a6caabb58f75a77/vendor/node/bin/npm" "install" "--production"
remote:        npm ERR! cwd /tmp/build_bf55002725acbaa28a6caabb58f75a77
remote:        npm ERR! node -v v0.10.35
remote:        npm ERR! npm -v 1.4.28
remote:        npm ERR! path /app/.npm/ea4720da-app-npm-lodash-2-4-1-package-tgz.lock
remote:        npm ERR! code EEXIST
remote:        npm ERR! errno 47
remote:        npm ERR! not ok code 0
remote: 
remote:  !     Push rejected, failed to compile Node.js app
remote: 
remote: Verifying deploy...

I was able to solve this problem by temporarily disabling Heroku's use of cache: 我可以通过暂时禁用Heroku对缓存的使用来解决此问题:

heroku config:set NODE_MODULES_CACHE=false

Push the build, then turn cache back on. 推送构建,然后重新打开缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM