Open trusktr opened 9 years ago
It's doing it with underscores too: Error: ENOENT, lstat '/Users/josephpea/src/trusktr_/documentjs/site/default/static'
By the way, I've got documentjs npm link
ed, so that's why it's looking there, in the repo I cloned.
Oh duh, it'd help to show you the full error:
/Users/josephpea/src/trusktr_documentjs/node_modules/q/q.js:126
throw e;
^
Error: ENOENT, lstat '/Users/josephpea/src/trusktr_/documentjs/site/default/static'
Is it q
's falt?
Even without any symbols trusktrdocumentjs
results in
Error: ENOENT, lstat '/Users/josephpea/src/trusktr/documentjs/site/default/static'
xD
just documentjs
works, so I'll use that temporarily.
Can you explain what your setup looks like in more detail. I don't know what you mean by "I have a folder". What does that mean?
Sent from my iPhone
On Jan 21, 2015, at 10:09 PM, Joseph Orbegoso Pea notifications@github.com wrote:
I have a folder called trusktr+documentjs. From the error it seems like documentjs is adding a slash to it, so that folder doesn't exist?
— Reply to this email directly or view it on GitHub.
So basically, to install documentjs, I cloned the repo from github, went into the repo folder, then ran npm link
so that documentjs is installed right from the repo folder globally. Now, when running documentjs
, I get that error.
DocumentJS is looking for /Users/josephpea/src/trusktr+/documentjs/site/default/static
, but it can't find it. The actual folder exists, and it is located in a different place: /Users/josephpea/src/trusktr+documentjs/site/default/static
DocumentJS (or one of it's dependencies?) seems to be looking in the wrong place.
For comparison:
/Users/josephpea/src/trusktr+/documentjs/site/default/static # wrong
/Users/josephpea/src/trusktr+documentjs/site/default/static # correct
documentjs (or a dep) is inserting that extra slash at runtime, so the file doesn't exist when it looks it up.
Ok, so you installed documentjs in a folder with a special character. I will check that out.
Why is that not in a node_modules folder?
ah, global install ... I haven't really tried that yet.
So this line is probably the problem:
https://github.com/bitovi/documentjs/blob/master/lib/fs_extras.js#L11
If you changed that to something like:
root = path.dirname(path.dirname(__dirname))
Let me know if that fixes it and I will get it into our version.
That didn't work, but path.dirname(__dirname)
does return the root of my local documentjs, /Users/josephpea/src/trusktr+documentjs
, so the fix would be not to assume that the app folder is called documentjs
in whatever other file that is happening in. Documentjs is appending /documentjs
to the root no matter what it is, when in fact the root has to end with trusktr+documentjs
. In whatever file that is, maybe you can just use the root without appending anything, and just use root = path.dirname(__dirname)
in fsx.
This is happening in another file?
Yep :+1: , the makdirs
, copy
, and exists
functions are receiving paths containing documentjs
, so the solution seems to be
// folder = "documentjs",
root = path.dirname(__dirname);
and make sure arguments to those functions don't contain documentjs
.
Working on this now. Not sure how this got dropped. Thanks!
:+1:
I have a folder called
trusktr+documentjs
. From the error it seems like documentjs is adding a slash to it, so that folder doesn't exist?