Closed max-mapper closed 7 months ago
Not sure if it is the same - I've got this and wonder which index file it is refering to:
# find . -name "index"
./.git/index
# dependency-check ./package.json
/usr/local/lib/node_modules/dependency-check/node_modules/resolve/lib/sync.js:33
throw new Error("Cannot find module '" + x + "' from '" + y + "'");
^
Error: Cannot find module './index' from '/home/user/project/node_modules'
at Function.module.exports [as sync] (/usr/local/lib/node_modules/dependency-check/node_modules/resolve/lib/sync.js:33:11)
at getDeps (/usr/local/lib/node_modules/dependency-check/index.js:116:22)
at /usr/local/lib/node_modules/dependency-check/index.js:157:9
at /usr/local/lib/node_modules/dependency-check/node_modules/async/lib/async.js:249:17
at /usr/local/lib/node_modules/dependency-check/node_modules/async/lib/async.js:125:13
at Array.forEach (native)
at _each (/usr/local/lib/node_modules/dependency-check/node_modules/async/lib/async.js:46:24)
at async.each (/usr/local/lib/node_modules/dependency-check/node_modules/async/lib/async.js:124:9)
at _asyncMap (/usr/local/lib/node_modules/dependency-check/node_modules/async/lib/async.js:248:13)
at Object.map (/usr/local/lib/node_modules/dependency-check/node_modules/async/lib/async.js:219:23)
@ensonic maybe try running with DEBUG=* dependency-check ./package.json
and see if that might hint at which module is causing it to look for ./index
? it might be that you need to change it to ./index.js
in your code to get it to work at the moment
Thanks for suggesting the obvious :)
dependency-check entry paths +0ms [ '/home/user/project/node_modules/.bin/noflo-nodejs' ]
dependency-check require("commander") is a dependency +40ms
dependency-check require("http") is core +2ms
dependency-check require("../index") is relative +0ms
dependency-check require("noflo") is a dependency +1ms
dependency-check require("noflo-runtime-websocket") is a dependency +0ms
dependency-check require("flowhub-registry") is a dependency +0ms
dependency-check require("querystring") is core +0ms
dependency-check resolve +0ms [ '/home/user/project/node_modules',
'./index' ]
/usr/local/lib/node_modules/dependency-check/node_modules/resolve/lib/sync.js:33
throw new Error("Cannot find module '" + x + "' from '" + y + "'");
in package.json I have:
"main": "./node_modules/.bin/noflo-nodejs",
Appending a '.js' there does not make a difference. Not sure why it even tries the non-existing 'node_modules/index'.
Ah its this line https://github.com/noflo/noflo-nodejs/blob/22a7ca8f3fef141bae96478f4f0d3a3dc940a67a/src/noflo-nodejs.coffee#L4
I opened an issue to track this https://github.com/maxogden/dependency-check/issues/26
On Tue, May 12, 2015 at 6:44 AM, Stefan Sauer notifications@github.com wrote:
Thanks for suggesting the obvious :)
dependency-check entry paths +0ms [ '/home/user/project/node_modules/.bin/noflo-nodejs' ] dependency-check require("commander") is a dependency +40ms dependency-check require("http") is core +2ms dependency-check require("../index") is relative +0ms dependency-check require("noflo") is a dependency +1ms dependency-check require("noflo-runtime-websocket") is a dependency +0ms dependency-check require("flowhub-registry") is a dependency +0ms dependency-check require("querystring") is core +0ms dependency-check resolve +0ms [ '/home/user/project/node_modules', './index' ] /usr/local/lib/node_modules/dependency-check/node_modules/resolve/lib/sync.js:33 throw new Error("Cannot find module '" + x + "' from '" + y + "'");
in package.json I have:
"main": "./node_modules/.bin/noflo-nodejs",
Appending a '.js' there does not make a difference. Not sure why it even tries the non-existing 'node_modules/index'.
— Reply to this email directly or view it on GitHub https://github.com/maxogden/dependency-check/issues/25#issuecomment-101286738 .
Experiencing the same issue, either using dependency-check localy (npm install --save-dev) or system-wide (npm install -g). Do you have any clue?
e.g. if you don't check a file into git, right now it blows up like this:
but it shouldn't crash