Open duralog opened 10 years ago
I have not been able to reproduce this - are you using the latest version on npmd?
can you post output of npmd-config
?
sure
{
"0": "npmd-config",
"dbPath": "/Users/duralog/.npmd",
"debug": false,
"sync": false,
"registry": "https://registry.npmjs.org",
"cache": "/Users/duralog/.npm",
"user-agent": "node/v0.10.28 darwin x64",
"prefix": "/usr/local",
"port": 5656,
"_": [],
"global": null,
"g": null,
"greedy": null,
"dedupe": null,
"online": null,
"offline": null,
"save-dev": null,
"D": null,
"saveDev": null,
"save": null,
"S": null,
"$0": "npmd-config",
"bin": "/tmp/npmd-config-bug/node_modules/.bin",
"userAgent": "node/v0.10.28 darwin x64",
"": [],
"d": null,
"s": null
}
lemme look a bit more into this a second... aha! I found the bug. you can reproduce perfectly like this:
mkdir -p /tmp/npmd-bug
cd /tmp/npmd-bug
cat > package.json << EOL
{
"name": "npmd-test",
"dependencies": {
"optimist": "x"
}
}
EOL
npmd install
npmd install npmd-config --greedy --global
now try it :)
notes:
rm -rf node_modules/optimist
(even though it's in package.json dependencies) it will now install properly.aha, so it's probably rchecking for already available modules in the ./node_modules etc, but it should look for that starting from where it will be installed (or just skip that step for global modules)
it gets mixed up with locals and globals for resolution... actually, this could be a npmd-resolve issue now that I think about it, but either way, it can be reproduced like this:
npmd install npmd-config --greedy
to install locallynpmd install -g npmd-config --greedy
to install globallynpmd-config
a try now on the terminal, and it will tell you that it can't find optimistright, so if you go to any other directory now and re-run the
npmd install -g npmd-config
, the--global
option will install the missing depsI don't think the greedy option makes any difference (didn't actually try it ... and come to think of it, why isn't greedy on by default?)
love npmd man :) it's great keep it real