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

Beefy does not find bundlers when there's an alternate npm global install path #70

Open
Sequoia opened this issue Dec 10, 2014 · 11 comments

Comments

@Sequoia
Copy link

Sequoia commented Dec 10, 2014

I install global packages in ~/npm/. npm exists in /usr/bin. Beefy seems to rely on the location of npm when looking for bundlers rather than calling which on the actual executable (e.g. watchify).

When I add console.log(dir[i]) in the for loop in setup-bundlers.onglobals I see that it's not looking in my ~/npm/ directory for browserify/watchify:

➜  beefy  cat ~/.npmrc 
prefix = /home/diamonds/npm
➜  beefy  which browserify
/home/diamonds/npm/bin/browserify
➜  beefy  which watchify 
/home/diamonds/npm/bin/watchify
➜  beefy  which npm
/usr/bin/npm
➜  beefy  cd -
~/treackpadello
➜  treackpadello git:(master) ✗ beefy         
>> entering setup-bundlers.onglobals
>> starting loop over dirs...
/usr/share/node-gyp
/usr/share/npm

/home/diamonds/npm/lib/node_modules/beefy/bin/beefy:13
    throw err;
          ^
Error: Could not find a suitable bundler!
    at onglobals (/home/diamonds/npm/lib/node_modules/beefy/lib/setup-bundlers.js:53:18)
    at /home/diamonds/npm/lib/node_modules/beefy/node_modules/find-global-packages/index.js:40:25
    at Object.cb [as oncomplete] (fs.js:168:19)
@Sequoia
Copy link
Author

Sequoia commented Dec 10, 2014

I can look for a fix maybe this weekend or sometime but don't wait up for me ⌚ 👀

@wachunga
Copy link

This is also affecting me, apparently.

@hansent
Copy link

hansent commented Feb 13, 2015

I trued sym-linking my brew npm into /usr/bin... that didn't help. however npm install -g browserify did the trick

@rathorer
Copy link

had same problem, npm install -g browserify worked for me too

@mattdesl
Copy link

mattdesl commented Apr 4, 2015

Also seeing this issue. I have npm config prefix set to a different path and npm install -g doesn't seem to solve this.

For the record, Beefy might be able to utilize this:
https://www.npmjs.com/package/resolve-npm-which

@mark-hahn
Copy link

With this command

nohup beefy src/main.coffee 1340 --cwd www --live \
            -- -o bundle.js -t coffeeify > run.log 2>&1 &

I am seeing

Cannot find module '/home/mark/Dropbox/apps/tv/browserify' from '/home/mark/Dropbox/apps/tv'

even though browserify is global and the command browserify works from the command line. I'll try making it local instead.

@mark-hahn
Copy link

I can't get beefy to find browserify no matter what I can think of to try. Can someone show me a setup that works?

  • browserify project folder (local or global?)
  • beefy project folder (local or global?)
  • beefy startup (command line or node module?)
  • entry file

@mattdesl
Copy link

mattdesl commented May 1, 2015

If you can't get it to work @mark-hahn you may have better luck with one of these tools:

https://github.com/mattdesl/budo
https://github.com/maxogden/wzrd

@mark-hahn
Copy link

Thanks. It's nice to know about these three options.

I got beefy to work by moving both beefy and browserify to local node_modules and removing the global installs. I also switched to just running a node file in my root directory with the beefy server code.

@ajuc
Copy link

ajuc commented Aug 15, 2015

I had same problem, solved it by adding --browserify $(which browserify) to the beefy start script in package.json of my project.

@rocLv
Copy link

rocLv commented Nov 15, 2015

@ajuc This works for me.
Should setup node_module path first?

Because I'm using zsh, so I add aliase beefy="beefy --browserify browserify“ to ~/.aliases file. Now I could use beefy again.

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

8 participants