Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow symlinks #29

Closed
kevgo opened this issue Jul 9, 2016 · 3 comments
Closed

Follow symlinks #29

kevgo opened this issue Jul 9, 2016 · 3 comments

Comments

@kevgo
Copy link
Contributor

kevgo commented Jul 9, 2016

There are newer package managers for Node out there that use symlinks, for example https://github.com/alexanderGugel/ied or https://github.com/rstacruz/pnpm. Dependency-lint is producing false errors for them. I think this is because it doesn't follow the symlink structure that they create in node_modules.

@charlierudolph
Copy link
Owner

What exactly are the false errors that are being produced?

@kevgo
Copy link
Contributor Author

kevgo commented Jul 11, 2016

When running dependency-lint on https://github.com/Originate/nitroglycerin with dependencies installed via ied, I get the error: mocha (unused)

Mocha is used in bin/tests, which looks like this:

#!/usr/bin/env bash
set -e

if [ "$#" == "0" ]; then
  mocha --compilers ls:livescript spec
else
  mocha --compilers ls:livescript "$@"
fi

A traditional install using NPM3 works correctly without dependency-lint errors.

IED changes the structure of the node_modules folder to contain symlinks to folders in the .cas directory. I assume dependency-lint is unable to follow these symlinks, hence it doesn't see the mocha binary in node_modules/.cas/161be5bdeb496771eb9b35745050b622b5aefc58/package/bin, and thinks mocha is unused.

Here is the structure of my node_modules folder for reference:

drwxr-xr-x   23 kevin  staff   782B Jul 11 12:04 .
drwxr-xr-x   18 kevin  staff   612B Jul 11 12:04 ..
drwxr-xr-x   15 kevin  staff   510B Jul 11 12:04 .bin
drwxr-xr-x  374 kevin  staff    12K Jul 11 12:04 .cas
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 chai -> .cas/4d02637b067fe958bdbfdd3a40ec56fef7373247/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 coveralls -> .cas/f9ff01a1adbf22a129e35a8d62345a52a781b395/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 dependency-lint -> .cas/83a1ec93a1b9d7427b68075a57029e3a0bb735da/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 gulp -> .cas/571ce45928dd40af6514fc4011866016c13845b4/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 gulp-concat -> .cas/585cfb115411f348773131140566b6a81c69cb91/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 gulp-exit -> .cas/082313548683ad0ab05d430d7a563330d4e61370/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 gulp-header -> .cas/e456f9390e5c86102d8f9b1fc49ca8f2b8902e0c/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 gulp-livescript -> .cas/d2d7e068c22921c1a573d6683946018a65f9cdb0/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 gulp-livescript-istanbul -> .cas/c50106ea1d8207519e44df66cc6edd23a0eca56f/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 gulp-mocha -> .cas/1ce5eba4b94b40c7436afec3c4982c8eea894192/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 gulp-uglify -> .cas/524788d87666d09f9d0c21fb2177f90039a658c9/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 gulp-util -> .cas/78925c4b8f8b49005ac01a011c557e6218941cbb/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 livescript -> .cas/4fe7121c41217e4608e334eb9cbe1762e63e5566/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 mocha -> .cas/161be5bdeb496771eb9b35745050b622b5aefc58/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 mocha-circleci-reporter -> .cas/9751273e919e8ea7c9e2d2128e18c374b0f4a817/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 o-tools -> .cas/3cd428e19d88718f403e7f0925c7b4be74495215/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 o-tools-livescript -> .cas/e07e67de0554a343e3f6f5c8953cefd3ee7d06ff/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 sinon -> .cas/4e4ff4d84b20adee13138f36acb132ca1cd72c83/package
lrwxr-xr-x    1 kevin  staff    53B Jul 11 12:04 sinon-chai -> .cas/432a9bbfd51a6fc00798f4d2526a829c060687ac/package

Running mocha itself works as expected.

Thanks!

@charlierudolph
Copy link
Owner

Alright, based on a short discussion with you I believe we need to update how we connect the executables with what module exposes them. Currently it is looking at the symlinks in the node_modules/.bin. Instead should probably just read the bin section of the each module's package.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants