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

Locally installed bower and --packageDir #32

Open
MattAlex151 opened this issue Jan 31, 2018 · 0 comments
Open

Locally installed bower and --packageDir #32

MattAlex151 opened this issue Jan 31, 2018 · 0 comments

Comments

@MattAlex151
Copy link

Hi, I have a bit of an esoteric bug to report.
Imagine my folder structure as:

  • package.json
  • other
    • bower.json

package.json installs bower and check-dependencies as devDependencies for the project.
So, I run, back to back:

$(npm bin)/check-dependencies --verbose --install
$(npm bin)/check-dependencies --verbose --install --package-manager bower --packageDir other/

but, if no bower_components are currently installed, the second command fails:
/bin/sh: 1: bower: not found
Invoking bower install...
and proceeds to not install anything.

I then noticed, if I replace with:

$(npm bin)/check-dependencies --verbose --install --package-manager $(npm bin)/bower --packageDir other/

Then it can find it and properly installs all the packages.
However, if I then re-run, and bower_components have been installed, it'll tell me that every package is not installed. So if I return to our first command, $(npm bin)/check-dependencies --verbose --install --package-manager bower --packageDir other/ now that bower_components are installed, then it'll report the correct versions and everything.

Finally, my solution ends up being:

echo -e "\e[93m\e[1mChecking Bower Packages...\e[0m"
$(npm bin)/check-dependencies --verbose --install --package-manager bower --packageDir other/ || $(npm bin)/check-dependencies --verbose --install --package-manager $(npm bin)/bower --packageDir other/

So here, on first run (no bower_components) the first command fails, therefor invoking the second version. Once that's done, all subsequent runs work with the first version.

Like I said, a bit esoteric but I figured I'd report it anyway. Thanks for the package, earlier I had tried rolling my own with npm ls and it was unacceptably slow. This package saved me a lot of time and I appreciate it!

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

1 participant