我添加到我的package.json上一行,它在本地工作得很好但是当我部署到heroku时它被拒绝了。
错误:未找到兼容版本:继承@' ^ 2.0.1'
的package.json
"googleapis": ">= 0.0.0",
Heroku部署日志:
-----> Deleting 2 files matching .slugignore patterns.
-----> Removing .DS_Store files
-----> Fetching custom git buildpack... done
-----> Node.js app detected
-----> Requested node range: 0.8.21
-----> Resolved node version: 0.8.21
-----> Downloading and installing node
-----> Restoring node_modules directory from cache
-----> Pruning cached dependencies not specified in package.json
-----> Exporting config vars to environment
-----> Installing dependencies
npm http GET https://registry.npmjs.org/googleapis
npm http 200 https://registry.npmjs.org/googleapis
npm http GET https://registry.npmjs.org/googleapis/-/googleapis-1.0.9.tgz
npm http 200 https://registry.npmjs.org/googleapis/-/googleapis-1.0.9.tgz
npm http GET https://registry.npmjs.org/async/0.2.10
npm http GET https://registry.npmjs.org/gapitoken/0.1.2
npm http GET https://registry.npmjs.org/multipart-stream/1.0.0
npm http GET https://registry.npmjs.org/request/2.37.0
npm http 200 https://registry.npmjs.org/gapitoken/0.1.2
npm http GET https://registry.npmjs.org/gapitoken/-/gapitoken-0.1.2.tgz
npm http 200 https://registry.npmjs.org/multipart-stream/1.0.0
npm http GET https://registry.npmjs.org/multipart-stream/-/multipart-stream-1.0.0.tgz
npm http 200 https://registry.npmjs.org/gapitoken/-/gapitoken-0.1.2.tgz
npm http 200 https://registry.npmjs.org/request/2.37.0
npm http 200 https://registry.npmjs.org/async/0.2.10
npm http GET https://registry.npmjs.org/request/-/request-2.37.0.tgz
npm http GET https://registry.npmjs.org/async/-/async-0.2.10.tgz
npm http 200 https://registry.npmjs.org/multipart-stream/-/multipart-stream-1.0.0.tgz
npm http 200 https://registry.npmjs.org/request/-/request-2.37.0.tgz
npm http 200 https://registry.npmjs.org/async/-/async-0.2.10.tgz
npm http GET https://registry.npmjs.org/jws/0.0.2
npm http GET https://registry.npmjs.org/sandwich-stream
npm http GET https://registry.npmjs.org/inherits
npm http 200 https://registry.npmjs.org/jws/0.0.2
npm http 200 https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/qs
npm http GET https://registry.npmjs.org/json-stringify-safe
npm http GET https://registry.npmjs.org/mime-types
npm http GET https://registry.npmjs.org/forever-agent
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/tough-cookie
npm http GET https://registry.npmjs.org/form-data
npm http GET https://registry.npmjs.org/tunnel-agent
npm http GET https://registry.npmjs.org/http-signature
npm http GET https://registry.npmjs.org/oauth-sign
npm http GET https://registry.npmjs.org/hawk/1.1.1
npm http GET https://registry.npmjs.org/aws-sign2
npm http GET https://registry.npmjs.org/jws/-/jws-0.0.2.tgz
npm http 200 https://registry.npmjs.org/mime-types
npm http 200 https://registry.npmjs.org/sandwich-stream
npm ERR! Error: No compatible version found: inherits@'^2.0.1'
npm ERR! Valid install targets:
npm ERR! ["1.0.0","2.0.0","2.0.1"]
npm ERR! at installTargetsError (/tmp/build_63edc9a5-ba9f-4380-9d67-15fc37cf717f/vendor/node/lib/node_modules/npm/lib/cache.js:679:10)
npm ERR! at /tmp/build_63edc9a5-ba9f-4380-9d67-15fc37cf717f/vendor/node/lib/node_modules/npm/lib/cache.js:594:10
npm ERR! at saved (/tmp/build_63edc9a5-ba9f-4380-9d67-15fc37cf717f/vendor/node/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:138:7)
npm ERR! at Object.oncomplete (fs.js:297:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.8.11-ec2
npm ERR! command "/tmp/build_63edc9a5-ba9f-4380-9d67-15fc37cf717f/vendor/node/bin/node" "/tmp/build_63edc9a5-ba9f-4380-9d67-15fc37cf717f/vendor/node/bin/npm" "install" "--userconfig" "/tmp/build_63edc9a5-ba9f-4380-9d67-15fc37cf717f/.npmrc" "--production"
npm ERR! cwd /tmp/build_63edc9a5-ba9f-4380-9d67-15fc37cf717f
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
有什么想法吗?
答案 0 :(得分:0)
解决了升级节点版本和npm的问题。节点为0.8.21,npm为1.2.10。
升级的package.json:
"node": "0.10.30",
"npm": "1.3.6"
事实上,似乎npm版本与heroku无关:
无需指定npm版本,因为npm与节点捆绑在一起。