Closed kartikTT closed 8 years ago
The key to the error:
remote: npm ERR! Error: version not found: ansi-styles@2.2.0
Your project is requesting that npm install https://www.npmjs.com/package/ansi-styles at version 2.2.0, but there is no release published with that version string. Try finding the package.json that declares ansi-styles v 2.2.0 and replacing it with 2.2.1, which exists.
Thanks for the quick response! I'm not specifying ansi-styles in my own packages.json, in the npm-shrinkwrap.json file I see the following:
"ansi-styles": {
"version": "1.1.0",
"from": "ansi-styles@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz"
},
but that shouldn't be a problem?
That looks like it shouldn't be a problem. But something else somewhere (perhaps a subdependency) is declaring 2.2.0. Try to see if there's something else you're depending on which specifies another version. There are a lot of things that depend on ansi-styles.
OK looks like I found the cause deep within one of my packages dependencies (see the ansi-styles dependency at the bottom). Not quite sure how I can edit the ansi dependency for chalk? Also, hasn't been an issue in any of my previous pushes with this buildpack.
{
"dependencies": {
"node-tangocard": {
"version": "0.1.1",
"dependencies": {
"request": {
"version": "2.69.0",
"dependencies": {
"aws-sign2": {
"version": "0.6.0"
},
"aws4": {
"version": "1.2.1",
"dependencies": {
"lru-cache": {
"version": "2.7.3"
}
}
},
"bl": {
"version": "1.0.3",
"dependencies": {
"readable-stream": {
"version": "2.0.5",
"dependencies": {
"core-util-is": {
"version": "1.0.2"
},
"inherits": {
"version": "2.0.1"
},
"isarray": {
"version": "0.0.1"
},
"process-nextick-args": {
"version": "1.0.6"
},
"string_decoder": {
"version": "0.10.31"
},
"util-deprecate": {
"version": "1.0.2"
}
}
}
}
},
"caseless": {
"version": "0.11.0"
},
"combined-stream": {
"version": "1.0.5",
"dependencies": {
"delayed-stream": {
"version": "1.0.0"
}
}
},
"extend": {
"version": "3.0.0"
},
"forever-agent": {
"version": "0.6.1"
},
"form-data": {
"version": "1.0.0-rc3",
"dependencies": {
"async": {
"version": "1.5.2"
}
}
},
"har-validator": {
"version": "2.0.6",
"dependencies": {
"chalk": {
"version": "1.1.1",
"dependencies": {
"ansi-styles": {
"version": "2.2.1",
"dependencies": {
"color-convert": {
"version": "1.0.0"
}
}
},
Looks like the thing you're quoting asks for ansi-styles version 2.2.1, so I don't think that's it. Your problem version is 2.2.0.
The buildpack recently started installing packages with npm for users of meteor 1.3 (https://github.com/AdmitHub/meteor-buildpack-horse/commit/eb6bb6cdbe098183f708f47c789348c06e1b5d52 )... so my guess would be either you weren't installing the node deps at all before, or you upgraded something to a version that referenced a subdependency with the wonky version.
Changing the version here doesn't solve, this is within my .meteor/local/isopacks/npm-container/node_modules/.npm-shrinkwrap.json
I think this is compiled on build? In which case I'd need to specify the version elsewhere but not sure where?
I'm on meteor 1.2.1 and the buildpack seems to be sticking with that when I push.
You'd need to change it in the upstream dependency (e.g. with a pull request to node-tangocard
), not with a change to meteor's generated shrinkwrap file.
Can you share your complete package.json?
Here's my packages.json for npm modules (only using two):
{
"node-tangocard":"0.1.1",
"sendwithus":"2.9.0"
}
For node-tangocard the only dependency is request@^2.51.0 - with ansi-styles nested deep within it, how would I change that version?
Here's the full package.json for the node-tangocard module:
{
"name": "node-tangocard",
"version": "0.1.1",
"description": "tangocard node.js simple sdk",
"main": "tangocard.js",
"scripts": {
"test": "./node_modules/mocha/bin/mocha -R spec --timeout 30000"
},
"contributors": [
{
"name": "Igor Skrynkovskyy",
"email": "skrynkovskyy@gmail.com"
}
],
"repository": {
"type": "git",
"url": "https://github.com/h2rd/node-tangocard.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/h2rd/node-tangocard/issues"
},
"homepage": "https://github.com/h2rd/node-tangocard",
"dependencies": {
"request": "^2.51.0"
},
"devDependencies": {
"chai": "^1.10.0",
"mocha": "^2.1.0"
},
"gitHead": "c757c5b415ca321a6bd3651253e84451aa9d2b44",
"_id": "node-tangocard@0.1.1",
"_shasum": "c5e297d4f43ab49910da6ab00f981f5f0f87deab",
"_from": "node-tangocard@0.1.1",
"_npmVersion": "2.5.1",
"_nodeVersion": "0.12.0",
"_npmUser": {
"name": "h2rd",
"email": "skrynkovskyy@gmail.com"
},
"maintainers": [
{
"name": "h2rd",
"email": "skrynkovskyy@gmail.com"
}
],
"dist": {
"shasum": "c5e297d4f43ab49910da6ab00f981f5f0f87deab",
"tarball": "http://registry.npmjs.org/node-tangocard/-/node-tangocard-0.1.1.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/node-tangocard/-/node-tangocard-0.1.1.tgz",
"readme": "ERROR: No README data found!"
}
I have a hunch that the ansi-styles problem has fixed itself. The version of node-tangocard that you are requesting percolates down to chalk@1.1.3 which declares ansi-styles ^2.2.1. This was updated 17 hours ago: https://github.com/chalk/chalk/commit/0d8d8c204eb87a4038219131ad4d8369c9f59d24
If you're still having errors when building on heroku, I think there's another error happening; the ansi-styles@2.2.0 issue shouldn't exist anymore unless you've somehow frozen an npm-shrinkwrap.
OK looks like we're close. I did the following:
1) reset my project 2) deleted npm-container & removed meteorhacks:npm 3) added meteorhacks:npm & ran the app
After doing this the .npm-shrinkwrap.json file shows:
"ansi-styles": {
"version": "2.2.1"
},
as you'd predicted and we want.
But when I push to heroku I get the same ansi-styles error (version not found: ansi-styles@2.2.0). Is there a config I need to change in the buildpack? Why would the app be loading the wrong version here when it looks for the updated version when I run locally?
Have you committed your changes since reloading npm?
Yup, committed after the steps I wrote above.
Also tried pushing to a brand new heroku app and still seeing the same error
My packages/npm-container/.npm/package/.gitignore
has node_modules
listed. I tried removing this and re-committing which adds all files in the directory but same error
Found a solution: Did all the steps mentioned above followed by:
heroku config:set NODE_MODULES_CACHE=FALSE
was able to push successfully. Hopefully that was the cause, though could have been something else. Will monitor closely and re-open if anything goes south. @yourcelf thanks for the help!
Today I encountered the same error with ansi-styles because I was depending on the request package through meteorhacks:npm.
For future readers, what I did to solve this issue was:
The problem was that the json file was under source control and the versions indicated there were used preventing npm from picking newer packages that do not depend on the removed version of ansi-styles. So the steps above are just refreshing the file. I don't know if there's another way of doing it.
I'm unable to successfully push, looks like an issue with the npm container? I've tried remove and re-adding meteorhacks:npm. Am I missing something here?