Open nrw opened 11 years ago
I just tested this and it worked for me, did you let --sync get up to 100? it's resolving it, so it's not that you don't have the stuff in the database.
what OS are you on?
npmd
is implemented as a bunch of separate tools, which is helpful when debugging.
can you try this:
npmd install npmd-install npmd-rebuild -g
npmd resolve level-test | npmd-install | npmd-rebuild
I did let --sync reach 100. I'm on Mac OS 10.9.
I did get a successful install with this:
npmd install npmd-install npmd-rebuild -g
npmd resolve level-test | npmd-install
I'm happy to have a work-around. :) The second command you suggested (unaltered) gives me this:
$ npmd resolve level-test | npmd-install | npmd-rebuild
/usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/clean.js:10
var deps = pkg.dependencies || {}
^
TypeError: Cannot read property 'dependencies' of undefined
at clean (/usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/clean.js:10:17)
at /usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/index.js:138:39
at loop (/usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/node_modules/pull-stream/sinks.js:11:19)
at drain (/usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/node_modules/pull-paramap/index.js:20:11)
at /usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/node_modules/pull-paramap/index.js:31:11
at next (/usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/node_modules/pull-stream/sources.js:93:14)
at /usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/node_modules/pull-stream/sources.js:98:16
at Array.<anonymous> (/usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/node_modules/pull-stream/sources.js:15:7)
at next (/usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/node_modules/pull-stream/sources.js:94:13)
at start (/usr/local/share/npm/lib/node_modules/npmd-rebuild/node_modules/npmd-tree/node_modules/pull-paramap/index.js:28:7)
events.js:72
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at errnoException (net.js:901:11)
at Object.afterWrite (net.js:718:19)
I still get the same error I reported from npmd install level-test
. Bug? Or broken installation for some other reason?
what version of npmd do you have?
npmd --version
I've been updating npmd very frequently recently, so you might try reinstalling it.
i was on 0.19.0 when i posted this issue. i've updated to 0.19.1 and still have this issue. i'm looking for a way to completely uninstall and remove the database for npmd
. doing this didn't solve the problem:
npm uninstall -g npmd
npm install -g npmd
npmd --sync # started at 99.84%
npmd install level-test # same error as the top of this post
i'll see what i can find. i'm still open to suggestions. :)
update: i uninstalled npmd
, removed the ~/.npmd
directory, installed npmd
with npm
, and ran npmd --sync
. i'm still getting the same error and i'm out of ideas for now. :P
oh! oops, I gave you the wrong syntax. I'm really sorry about this, I hadn't added the stdin handling to npmd-rebuild yet. thank you so much for bearing with me.
you just want to run npmd-rebuild
after npmd-install
so the correct command should just be this:
npmd resolve level-test | npmd-install && npmd-rebuild
Although, that doesn't explain the broken npmd result. can you try that? and also, can you post the output of
npmd-tree
AHA!!!! I think I have it!
do you or do you not have a package.json
in the directory you are running the npmd-rebuild
command from? right now it's assuming that there is a package.json
. The first thing is a better error message for that thing, and the second thing is probably to make it still work without a package.json
pretty sure this is it! getting very similar output to you
first: here's the output of npmd-tree
{
"name": "instances",
"version": "0.0.0",
"dependencies": {
"coffee-script": {
"name": "coffee-script",
"version": "1.6.3",
"from": "1.x.x"
},
"level": {
"name": "level",
"version": "0.18.0",
"dependencies": {
"level-packager": {
"name": "level-packager",
"version": "0.18.0",
"from": "~0.18.0",
"dependencies": {
"levelup": {
"name": "levelup",
"version": "0.18.2",
"from": "~0.18.0",
"dependencies": {
"bops": {
"name": "bops",
"version": "0.1.1",
"from": "~0.1.0",
"dependencies": {
"base64-js": {
"name": "base64-js",
"version": "0.0.2",
"from": "0.0.2"
},
"to-utf8": {
"name": "to-utf8",
"version": "0.0.1",
"from": "0.0.1"
}
}
},
"concat-stream": {
"name": "concat-stream",
"version": "0.1.1",
"from": "~0.1.1"
},
"deferred-leveldown": {
"name": "deferred-leveldown",
"version": "0.1.0",
"from": "~0.1.0",
"dependencies": {
"abstract-leveldown": {
"name": "abstract-leveldown",
"version": "0.10.2",
"from": "~0.10.1"
},
"bops": {
"name": "bops",
"version": "0.0.7",
"from": "~0.0.6",
"dependencies": {
"base64-js": {
"name": "base64-js",
"version": "0.0.2",
"from": "0.0.2"
},
"to-utf8": {
"name": "to-utf8",
"version": "0.0.1",
"from": "0.0.1"
}
}
}
}
},
"errno": {
"name": "errno",
"version": "0.1.0",
"from": "~0.1.0",
"dependencies": {
"prr": {
"name": "prr",
"version": "0.0.0",
"from": "~0.0.0"
}
}
},
"prr": {
"name": "prr",
"version": "0.0.0",
"from": "~0.0.0"
},
"readable-stream": {
"name": "readable-stream",
"version": "1.0.17",
"from": "~1.0.17"
},
"semver": {
"name": "semver",
"version": "2.2.1",
"from": "~2.2.1"
},
"xtend": {
"name": "xtend",
"version": "2.1.1",
"from": "~2.1.1",
"dependencies": {
"object-keys": {
"name": "object-keys",
"version": "0.4.0",
"from": "~0.4.0"
}
}
}
}
}
}
},
"leveldown": {
"name": "leveldown",
"version": "0.10.2",
"gypfile": true,
"from": "~0.10.0",
"dependencies": {
"bindings": {
"name": "bindings",
"version": "1.1.1",
"from": "~1.1.1"
},
"nan": {
"name": "nan",
"version": "0.6.0",
"from": "~0.6.0"
}
}
}
}
},
"level-test": {
"name": "level-test",
"version": "1.5.2",
"dependencies": {
"level": {
"name": "level",
"version": "0.18.0",
"from": ">=0.17",
"dependencies": {
"level-packager": {
"name": "level-packager",
"version": "0.18.0",
"from": "~0.18.0",
"dependencies": {
"levelup": {
"name": "levelup",
"version": "0.18.2",
"from": "~0.18.0",
"dependencies": {
"bops": {
"name": "bops",
"version": "0.1.1",
"from": "~0.1.0",
"dependencies": {
"base64-js": {
"name": "base64-js",
"version": "0.0.2",
"from": "0.0.2"
},
"to-utf8": {
"name": "to-utf8",
"version": "0.0.1",
"from": "0.0.1"
}
}
},
"concat-stream": {
"name": "concat-stream",
"version": "0.1.1",
"from": "~0.1.1"
},
"deferred-leveldown": {
"name": "deferred-leveldown",
"version": "0.1.0",
"from": "~0.1.0",
"dependencies": {
"abstract-leveldown": {
"name": "abstract-leveldown",
"version": "0.10.2",
"from": "~0.10.1"
},
"bops": {
"name": "bops",
"version": "0.0.7",
"from": "~0.0.6",
"dependencies": {
"base64-js": {
"name": "base64-js",
"version": "0.0.2",
"from": "0.0.2"
},
"to-utf8": {
"name": "to-utf8",
"version": "0.0.1",
"from": "0.0.1"
}
}
}
}
},
"errno": {
"name": "errno",
"version": "0.1.0",
"from": "~0.1.0",
"dependencies": {
"prr": {
"name": "prr",
"version": "0.0.0",
"from": "~0.0.0"
}
}
},
"prr": {
"name": "prr",
"version": "0.0.0",
"from": "~0.0.0"
},
"readable-stream": {
"name": "readable-stream",
"version": "1.0.17",
"from": "~1.0.17"
},
"semver": {
"name": "semver",
"version": "2.2.1",
"from": "~2.2.1"
},
"xtend": {
"name": "xtend",
"version": "2.1.1",
"from": "~2.1.1",
"dependencies": {
"object-keys": {
"name": "object-keys",
"version": "0.4.0",
"from": "~0.4.0"
}
}
}
}
}
}
},
"leveldown": {
"name": "leveldown",
"version": "0.10.2",
"gypfile": true,
"from": "~0.10.0",
"dependencies": {
"bindings": {
"name": "bindings",
"version": "1.1.1",
"from": "~1.1.1"
},
"nan": {
"name": "nan",
"version": "0.6.0",
"from": "~0.6.0"
}
}
}
}
},
"level-js": {
"name": "level-js",
"version": "1.0.8",
"from": "~1.0.8",
"dependencies": {
"abstract-leveldown": {
"name": "abstract-leveldown",
"version": "0.7.2",
"from": "0.7.2"
},
"idb-wrapper": {
"name": "idb-wrapper",
"version": "1.2.0",
"from": "~1.2.0"
},
"isbuffer": {
"name": "isbuffer",
"version": "0.0.0",
"from": "~0.0.0"
}
}
},
"memdown": {
"name": "memdown",
"version": "0.5.1",
"from": "~0.5.1",
"dependencies": {
"abstract-leveldown": {
"name": "abstract-leveldown",
"version": "0.11.1",
"from": "~0.11.0",
"dependencies": {
"xtend": {
"name": "xtend",
"version": "2.1.1",
"from": "~2.1.1",
"dependencies": {
"object-keys": {
"name": "object-keys",
"version": "0.4.0",
"from": "~0.4.0"
}
}
}
}
},
"bops": {
"name": "bops",
"version": "0.1.1",
"from": "~0.1.0",
"dependencies": {
"base64-js": {
"name": "base64-js",
"version": "0.0.2",
"from": "0.0.2"
},
"to-utf8": {
"name": "to-utf8",
"version": "0.0.1",
"from": "0.0.1"
}
}
}
}
},
"osenv": {
"name": "osenv",
"version": "0.0.3",
"from": "0.0.3"
},
"rimraf": {
"name": "rimraf",
"version": "2.2.4",
"from": "~2.2.2",
"dependencies": {
"graceful-fs": {
"name": "graceful-fs",
"version": "2.0.1"
}
}
}
}
},
"mocha": {
"name": "mocha",
"version": "1.14.0",
"dependencies": {
"commander": {
"name": "commander",
"version": "2.0.0",
"from": "2.0.0"
},
"debug": {
"name": "debug",
"version": "0.7.4",
"from": "*"
},
"diff": {
"name": "diff",
"version": "1.0.7",
"from": "1.0.7"
},
"glob": {
"name": "glob",
"version": "3.2.3",
"from": "3.2.3",
"dependencies": {
"graceful-fs": {
"name": "graceful-fs",
"version": "2.0.1",
"from": "~2.0.0"
},
"inherits": {
"name": "inherits",
"version": "2.0.1",
"from": "2"
},
"minimatch": {
"name": "minimatch",
"version": "0.2.12",
"from": "~0.2.11",
"dependencies": {
"lru-cache": {
"name": "lru-cache",
"version": "2.5.0",
"from": "2"
},
"sigmund": {
"name": "sigmund",
"version": "1.0.0",
"from": "~1.0.0"
}
}
}
}
},
"growl": {
"name": "growl",
"version": "1.7.0",
"from": "1.7.x"
},
"jade": {
"name": "jade",
"version": "0.26.3",
"from": "0.26.3",
"dependencies": {
"commander": {
"name": "commander",
"version": "0.6.1",
"from": "0.6.1"
},
"mkdirp": {
"name": "mkdirp",
"version": "0.3.0",
"from": "0.3.0"
}
}
},
"mkdirp": {
"name": "mkdirp",
"version": "0.3.5",
"from": "0.3.5"
}
}
},
"npmd-tree": {
"name": "npmd-tree",
"version": "3.3.3",
"dependencies": {
"continuable": {
"name": "continuable",
"version": "1.1.8",
"from": "~1.1.8"
},
"continuable-para": {
"name": "continuable-para",
"version": "1.2.0",
"from": "~1.2.0",
"dependencies": {
"continuable-hash": {
"name": "continuable-hash",
"version": "0.1.4",
"from": "~0.1.4",
"dependencies": {
"continuable": {
"name": "continuable",
"version": "1.1.8",
"from": "~1.1.6"
}
}
},
"continuable-list": {
"name": "continuable-list",
"version": "0.1.6",
"from": "~0.1.5",
"dependencies": {
"continuable": {
"name": "continuable",
"version": "1.1.8",
"from": "~1.1.6"
}
}
}
}
},
"npmd-config": {
"name": "npmd-config",
"version": "1.0.7",
"from": "~1.0.3",
"dependencies": {
"optimist": {
"name": "optimist",
"version": "0.6.0",
"from": "~0.6.0",
"dependencies": {
"minimist": {
"name": "minimist",
"version": "0.0.5",
"from": "~0.0.1"
},
"wordwrap": {
"name": "wordwrap",
"version": "0.0.2",
"from": "~0.0.2"
}
}
},
"osenv": {
"name": "osenv",
"version": "0.0.3",
"from": "~0.0.3"
},
"rc": {
"name": "rc",
"version": "0.3.2",
"from": "~0.3.1",
"dependencies": {
"deep-extend": {
"name": "deep-extend",
"version": "0.2.6",
"from": "~0.2.5"
},
"ini": {
"name": "ini",
"version": "1.1.0",
"from": "~1.1.0"
},
"optimist": {
"name": "optimist",
"version": "0.3.7",
"from": "~0.3.4",
"dependencies": {
"wordwrap": {
"name": "wordwrap",
"version": "0.0.2",
"from": "~0.0.2"
}
}
}
}
},
"to-camel-case": {
"name": "to-camel-case",
"version": "0.2.0",
"from": "~0.2.0"
}
}
},
"pull-fs": {
"name": "pull-fs",
"version": "1.1.3",
"from": "1.1.3",
"dependencies": {
"pull-split": {
"name": "pull-split",
"version": "0.1.2",
"from": "~0.1.1",
"dependencies": {
"pull-through": {
"name": "pull-through",
"version": "1.0.10",
"from": "~1.0.6",
"dependencies": {
"pull-stream": {
"name": "pull-stream",
"version": "2.20.1",
"from": "~2.20",
"dependencies": {
"pull-core": {
"name": "pull-core",
"version": "1.0.0",
"from": "~1.0.0"
}
}
}
}
}
}
},
"pull-stream": {
"name": "pull-stream",
"version": "2.20.1",
"from": "~2.20",
"dependencies": {
"pull-core": {
"name": "pull-core",
"version": "1.0.0",
"from": "~1.0.0"
}
}
}
}
},
"pull-paramap": {
"name": "pull-paramap",
"version": "1.0.4",
"from": "~1.0.4",
"dependencies": {
"pull-stream": {
"name": "pull-stream",
"version": "2.20.1",
"from": "2.20",
"dependencies": {
"pull-core": {
"name": "pull-core",
"version": "1.0.0",
"from": "~1.0.0"
}
}
}
}
},
"pull-stream": {
"name": "pull-stream",
"version": "2.20.0",
"from": "2.20.0",
"dependencies": {
"pull-core": {
"name": "pull-core",
"version": "1.0.0",
"from": "~1.0.0"
}
}
}
}
}
}
}
this is the result of the latest rebuild
command:
$ npmd resolve level-test | npmd-install && npmd-rebuild
WARN cd6ad8ddb290915ad9e22765576025d411f29cb6!==cd3dbfae582692563b85c1be7faea0990e047b27
redownloading: osenv@0.0.3==cd6ad8ddb290915ad9e22765576025d411f29cb6
WARN 7fd6e0a4837c35d0cc15330294d9584a3898cf84!==ec829a5953ea8ab7c1ba4c5de223ad6a44432ad6
redownloading: graceful-fs@2.0.1==7fd6e0a4837c35d0cc15330294d9584a3898cf84
GET http://isaacs.iriscouch.com/registry/osenv/osenv-0.0.3.tgz
GET http://isaacs.iriscouch.com/registry/graceful-fs/graceful-fs-2.0.1.tgz
WARN 9f0b530f829f7b655a6e4d2fd8cf4c042336ef58!==cbac6a7758c95ee16b75096091e0ad4bfae7ce76
redownloading: rimraf@2.2.4==9f0b530f829f7b655a6e4d2fd8cf4c042336ef58
GET http://isaacs.iriscouch.com/registry/rimraf/rimraf-2.2.4.tgz
{
"name": "level-test",
"version": "1.5.2",
"shasum": "2c447023254cdd24b7bf2cf905d3052d0e4a2a07",
"path": "/Users/nrw/instances/node_modules",
"tmp": "/var/folders/d7/m51x5vt94299zydqhq7yq1pr0000gn/T/npmd-unpack-1385964451997-0.2311705225147307/package"
}
/usr/local/share/npm/lib/node_modules/npmd-rebuild/index.js:33
if(err) throw err
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
I don't want to rain on your "AHA!". :P
... but i do have a package.json
in this folder. It looks like this:
{
"name": "instances",
"description": "instance registry",
"version": "0.0.0",
"main": "index.coffee",
"scripts": {
"start": "coffee index.coffee"
},
"dependencies": {
"coffee-script": "1.x.x"
},
"devDependencies": {
"mocha": "1.x.x"
}
}
One more thing that might be related: installing packages like this: npmd install -g npmd-rebuild
, does not result in adding a npmd-rebuild
command to my path. it works without the global flag. it works with npm
instead of npmd
. Is there some configuration that needs to be done to have npmd
drop bin
files in npm
's bin
?
Ah, bummer. okay, now I can use that to install the deps you have and see if there are any problems... okay. I am installing your thing, hopefully I can reproduce this.
how did you install node? can you tell me the output of these commands:
npm config list --long #show npm's config
which npmd #where did it put the npmd bin symlink
ls -l `which npmd` #where did it install npmd
which node #where is node installed.
I have implemented adding -g commands, and it works on my setup. This will help me figure out how to run it on osx
okay, I saw the same problem installing from your tree.
I fixed a few things, and now it works for me.
in can you install the latest npmd-rebuild@0.1.0 and try that? just run
npmd-rebuild` from your instances directory?
I installed node with homebrew. Here are the commands you requested.
$ npm config list --long
; cli configs
long = true
registry = "https://registry.npmjs.org/"
; userconfig /Users/nrw/.npmrc
loglevel = "http"
; builtin config undefined
prefix = "/usr/local/share/npm"
; default values
always-auth = false
bin-links = true
browser = null
cache = "/Users/nrw/.npm"
cache-lock-retries = 10
cache-lock-stale = 60000
cache-lock-wait = 10000
cache-max = null
cache-min = 10
color = true
coverage = false
depth = null
description = true
dev = false
editor = "nano"
engine-strict = false
fetch-retries = 2
fetch-retry-factor = 10
fetch-retry-maxtimeout = 60000
fetch-retry-mintimeout = 10000
force = false
git = "git"
global = false
globalconfig = "/usr/local/share/npm/etc/npmrc"
globalignorefile = "/usr/local/share/npm/etc/npmignore"
group = 20
https-proxy = null
ignore = ""
init-module = "/Users/nrw/.npm-init.js"
init.author.email = ""
init.author.name = ""
init.author.url = ""
init.version = "0.0.0"
json = false
link = false
loglevel = "http"
; long = false (overridden)
message = "%s"
node-version = "v0.10.22"
npat = false
npaturl = "http://npat.npmjs.org/"
onload-script = false
optional = true
parseable = false
pre = false
; prefix = "/usr/local/Cellar/node/0.10.22" (overridden)
production = false
proprietary-attribs = true
proxy = null
rebuild-bundle = true
registry = "https://registry.npmjs.org/"
rollback = true
save = false
save-bundle = false
save-dev = false
save-optional = false
searchexclude = null
searchopts = ""
searchsort = "name"
shell = "/bin/bash"
shrinkwrap = true
sign-git-tag = false
strict-ssl = true
tag = "latest"
tmp = "/var/folders/d7/m51x5vt94299zydqhq7yq1pr0000gn/T/"
umask = 18
unicode = true
unsafe-perm = true
usage = false
user = 501
user-agent = "node/v0.10.22 darwin x64"
userconfig = "/Users/nrw/.npmrc"
userignorefile = "/Users/nrw/.npmignore"
username = ""
version = false
versions = false
viewer = "man"
yes = null
$ which npmd
/usr/local/share/npm/bin/npmd
$ ls -l `which npmd`
lrwxr-xr-x 1 nrw wheel 33 Dec 1 18:12 /usr/local/share/npm/bin/npmd -> ../lib/node_modules/npmd/index.js
$ which node
/usr/local/bin/node
We have a slightly more specific error with npmd-rebuild
:
# in ~/instances
$ npm install -g npmd-rebuild
# normal install noise was here. successful install.
$ npmd-rebuild -v
0.1.0
$ npmd-rebuild
ERROR with node-gyp
1
/usr/local/share/npm/lib/node_modules/npmd-rebuild/index.js:39
throw err
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
cool, that is progress.
Also, an obvious solution,
I was assuming node-gyp was in your path.
I've updated npmd-rebuild@0.1.1
so that
it depends on it's own node-gyp
version
and will refer to that exactly.
do you use sudo when you npm install X -g
?
figuring out the -g stuff is a little more complex, but I think we are nearly there with npmd-rebuild
.
I do not use sudo when I npm install X -g
.
I kinda thought i had node-gyp
in my path too, but I don't.
I think we've resolved the npmd-rebuild
issue! 0.1.1
built successfully (let me know if you want this full output).
$ npmd-rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@0.12.1
gyp info using node@0.10.22 | darwin | x64
gyp info it worked if it ends with ok
...
gyp info ok
Thanks for hacking on that!
YUSS! awesome! thanks for helping me with this. Cool, I'll have a look into this -g thing.
the original issue posted seems to now be resolved (as of 0.20.0
). npmd install level-test
behaves as expected. installing with -g still does not behave correctly.
ah, I havn't been working on npmd this week, I should get back to it shortly, though.
no worries, just wanted anyone viewing this issue to have an update. thanks for your work!
I'm getting this for several modules. This is right after a
npmd --sync
. Am I skipping a step?This is the output of
npmd resolve level-test