简体   繁体   English

Heroku上的特定npm版本

[英]Specific npm version on Heroku

I'm trying to push my web app on Heroku however it requires a specific NPM version (>2.0 namely because I want to install modules from local paths ). 我正在尝试在Heroku上推送我的Web应用程序但是它需要特定的NPM版本(> 2.0,因为我想从本地路径安装模块)。

I tried specifying the npm version I want in my package.json file like this: 我尝试在我的package.json文件中指定我想要的npm版本,如下所示:

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

But it does not work. 但它不起作用。 I get the following: 我得到以下内容:

[13:26:09][Step 3/3] 80 http 200 https://registry.npmjs.org/mailgun
[13:26:09][Step 3/3] 81 silly registry.get cb [ 200,
[13:26:09][Step 3/3] 81 silly registry.get   { date: 'Wed, 12 Nov 2014 18:26:08 GMT',
[13:26:09][Step 3/3] 81 silly registry.get     server: 'CouchDB/1.5.0 (Erlang OTP/R16B03)',
[13:26:09][Step 3/3] 81 silly registry.get     etag: '"4TEYXG8V5ESBTLTLYGNM1K3VM"',
[13:26:09][Step 3/3] 81 silly registry.get     'content-type': 'application/json',
[13:26:09][Step 3/3] 81 silly registry.get     'cache-control': 'max-age=60',
[13:26:09][Step 3/3] 81 silly registry.get     'content-length': '14782',
[13:26:09][Step 3/3] 81 silly registry.get     'accept-ranges': 'bytes',
[13:26:09][Step 3/3] 81 silly registry.get     via: '1.1 varnish',
[13:26:09][Step 3/3] 81 silly registry.get     age: '44',
[13:26:09][Step 3/3] 81 silly registry.get     'x-served-by': 'cache-jfk1024-JFK',
[13:26:09][Step 3/3] 81 silly registry.get     'x-cache': 'HIT',
[13:26:09][Step 3/3] 81 silly registry.get     'x-cache-hits': '1',
[13:26:09][Step 3/3] 81 silly registry.get     'x-timer': 'S1415816768.787241,VS0,VE0',
[13:26:09][Step 3/3] 81 silly registry.get     vary: 'Accept',
[13:26:09][Step 3/3] 81 silly registry.get     'keep-alive': 'timeout=10, max=50',
[13:26:09][Step 3/3] 81 silly registry.get     connection: 'Keep-Alive' } ]
[13:26:09][Step 3/3] 82 silly lockFile 17d20b4b-mailgun-file-vendor-node-mailgun mailgun@file:./vendor/node-mailgun
[13:26:09][Step 3/3] 83 silly lockFile 17d20b4b-mailgun-file-vendor-node-mailgun mailgun@file:./vendor/node-mailgun
[13:26:09][Step 3/3] 84 error notarget No compatible version found: mailgun@'file:./vendor/node-mailgun'
[13:26:09][Step 3/3] 84 error notarget Valid install targets:
[13:26:09][Step 3/3] 84 error notarget ["0.1.6","0.4.0","0.4.1","0.4.2","0.4.3","0.5.0"]
[13:26:09][Step 3/3] 84 error notarget
[13:26:09][Step 3/3] 84 error notarget This is most likely not a problem with npm itself.
[13:26:09][Step 3/3] 84 error notarget In most cases you or one of your dependencies are requesting
[13:26:09][Step 3/3] 84 error notarget a package version that doesn't exist.
[13:26:09][Step 3/3] 85 error System Linux 3.8.11-ec2
[13:26:09][Step 3/3] 86 error command "/tmp/build_1e56200e13db384069333f3304918966/vendor/node/bin/node" "/tmp/build_1e56200e13db384069333f3304918966/vendor/node/bin/npm" "install" "--userconfig" "/tmp/build_1e56200e13db384069333f3304918966/.npmrc" "--production"
[13:26:09][Step 3/3] 87 error cwd /tmp/build_1e56200e13db384069333f3304918966
[13:26:09][Step 3/3] 88 error node -v v0.10.33
[13:26:09][Step 3/3] 89 error npm -v 1.4.28
[13:26:09][Step 3/3] 90 error code ETARGET
[13:26:09][Step 3/3] 91 verbose exit [ 1, true ]
[13:26:09][Step 3/3] 
[13:26:09][Step 3/3]  !     Push rejected, failed to compile Multipack app
[13:26:09][Step 3/3] 
[13:26:09][Step 3/3] To git@heroku.com:supportkit-test.git
[13:26:09][Step 3/3]  ! [remote rejected] deploy -> master (pre-receive hook declined)
[13:26:09][Step 3/3] error: failed to push some refs to 'git@heroku.com:supportkit-test.git'
[13:26:09][Step 3/3] Process exited with code 1

Mailgun is a module I want to install from a local path. Mailgun是我想从本地路径安装的模块。 As you can see, the npm version is still 1.4.28. 如您所见,npm版本仍为1.4.28。

Any idea on how to force a specific NPM version on Heroku? 关于如何在Heroku上强制使用特定NPM版本的任何想法?

Thanks! 谢谢!

如果您需要默认情况下在Heroku上不可用的特定版本的NPM,那么您将需要构建自定义构建包

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

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