Reputation: 351
Having problems running npm install redis. Got error:
npm WARN install Refusing to install redis as a dependency of itself
When I tried to install hiredis it would appear to install just fine however, when I tried to run any of the examples they would fail with the required file "redis" not found.
I did finally solve this by installing redis global or:
npm install -g redis
Has anyone else seen this?
Upvotes: 4
Views: 3196
Reputation: 1886
Ensure your app package.json
name is not redis.
Good package.json
{
"name": "redis-app"
//...
}
Bad package.json
{
"name": "redis"
//...
}
Upvotes: 10
Reputation: 3109
Matthew's comment is correct. This error will occur when your folder name is the same as an NPM module. So just change your folder name from redis to redisApp or something.
Upvotes: 2