buttercup / buttercup-core

:tophat: The mighty NodeJS password vault
http://buttercup.pw/
MIT License
469 stars 57 forks source link

Cannot find module '__buttercup/classes/Archive.js' #70

Closed Jameskmonger closed 8 years ago

Jameskmonger commented 8 years ago

error message

@himynameisdave can you provide some more info on this?

himynameisdave commented 8 years ago

yeah not too sure what's causing it.... I try to run git-labelmaker and I get this error.

Deleting node_modules in my global git-labelmaker pkg solves the issue

perry-mitchell commented 8 years ago

This has to do with the symlink buttercup uses for locating files. Could you post your node and npm versions?

Jameskmonger commented 8 years ago

I think I know the issue, @perry-mitchell. The links between source files (not just test to source files) are also using the symlink. This means that the symlink script needs to always work properly for the source to work. It'd probably be safer to use internal relative links when going from source to source. I'll submit a PR.

Jameskmonger commented 8 years ago

Please see #71

perry-mitchell commented 8 years ago

I'd like to avoid using rel links - the absolute paths work well downstream with Browserify which is one of the main users of buttercup core.

We should find what's causing the issue, as this isn't an issue in other projects.

Jameskmonger commented 8 years ago

Okay, that's fine with me. I'm not able to replicate the issue locally. @himynameisdave, could you zip up your exact git-labelmaker folder (including node_modules) and upload it to Google Drive or something similar? It'd be good to be able to inspect it properly.

himynameisdave commented 8 years ago

@Jameskmonger Yep, here ya go: git-labelmaker.zip

Did not include the .git/ or .gitignore. Haven't noticed the issue since last night, it's really hard to reproduce.

himynameisdave commented 8 years ago

@perry-mitchell @Jameskmonger status?

Jameskmonger commented 8 years ago

I'm able to reproduce it using your .zip and will look into it later @himynameisdave :smile:

Jameskmonger commented 8 years ago

@perry-mitchell I think I'm beginning to understand the problem.

The node_modules/buttercup/node_modules folder has a single file in it (not a symlink) called __buttercup, which contains the following contents:

../source

It appears to be treating it as a file rather than as a symlink.

perry-mitchell commented 8 years ago

That may be because it was zipped or OS differences. I'm not well versed in the low level configuration that a symlink goes through when it's created. @himynameisdave could you share your current node setup, versions etc? Npm should look in node_modules for the path specified (__buttercup symlink points from there to source). Perhaps you could send the output of ls -la from within node_modules too.

himynameisdave commented 8 years ago

Thanks for looking into this guys, let me know if you need anything from me

perry-mitchell commented 8 years ago

@himynameisdave Also, as I'm waiting for access to be granted to your archive, would you mind telling us what version of Buttercup is installed in your labelmaker clone? There were problems with symlinks in a couple of versions prior to the current, so we should ensure you're up to date.

himynameisdave commented 8 years ago

@perry-mitchell I believe it's 0.17.0 and you should have access now

edit can confirm, it is using 0.17.0

perry-mitchell commented 8 years ago

That's strange.. on my machine (Ubuntu 14.04), unzipping your archive leaves me with a correct-looking copy of buttercup in your labelmaker's node_modules:

perry@nostromo:~/Temp/git-labelmaker-compress/node_modules/buttercup/node_modules$ ll
total 12
drwxr-xr-x 2 perry perry 4096 maali 24 22:10 ./
drwxr-xr-x 8 perry perry 4096 maali 24 22:10 ../
lrwxrwxrwx 1 perry perry    9 maali 24 22:10 __buttercup -> ../source/
perry@nostromo:~/Temp/git-labelmaker-compress/node_modules/buttercup/node_modules$ cd __buttercup
perry@nostromo:~/Temp/git-labelmaker-compress/node_modules/buttercup/node_modules/__buttercup$ ls
classes  data  encryption  module.js  tools

You've probably tried already, but could you manually delete just "buttercup" and run npm install again? Check for the symlink after that, see if you can cd into it. If that doesn't work, delete it again and try running just npm install buttercup.

himynameisdave commented 8 years ago

Done all that, haven't been able to reproduce this issue since doing it so maybe that fixed things?

Thanks guys

perry-mitchell commented 8 years ago

As we're no longer using symlinks, I'm closing this issue (ref: rel links). Please submit a new issue if the problem still occurs.