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

Cannot find module './support/isBuffer' #365

Open
ekkis opened this issue Nov 19, 2015 · 6 comments
Open

Cannot find module './support/isBuffer' #365

ekkis opened this issue Nov 19, 2015 · 6 comments

Comments

@ekkis
Copy link

ekkis commented Nov 19, 2015

I have a directory with tests I wish to browserify. if I do it by hand everything works fine:

$ cd tests/browser
$ browserify -o tests.js *.js

but in trying to automate it by putting the following into the Gruntfile.js:

browserify: {
    test: {
        src: ['test/browser/*.js'],
        dest: 'test/browser/tests.js'
    }
},

something goes wrong and when I try to run the tests I get:

$ grunt test-web
Running "browserify:test" (browserify) task

Error: Cannot find module './support/isBuffer' from '/Users/ekkis/Development/tst/test/browser'
Warning: Error running grunt-browserify. Use --force to continue.

Aborted due to warnings.

am I misconfiguring the plugin? help?

@simonlovesyou
Copy link

I have the same problem, I think it's trying to look for
node_modules/grunt-browserify/node_modules/browserify/node_modules/util/support/isBuffer.js
but it's looking for it in the current project directory.

@simonlovesyou
Copy link

I managed to fix my problem, seems like you can't use globbing patterns in files.src array if you also have a files.dest.

What caused my error:

files: {
  src: ['path/to/files/*.js'], 
  dest: 'whatever/file.js'
}

The fix:

files: {
  'whatever/file.js': ['path/to/files/*.js']
}

not sure if this is a bug or intentional.

@ekkis
Copy link
Author

ekkis commented Jan 11, 2016

nah. you can use globs. I got it to work without changing the configuration but I no longer know what I did to make it work... I think I upgraded npm

@chiragmongia
Copy link

@ekkis I have the same problem. Could you find a solution to it?

@ekkis
Copy link
Author

ekkis commented Aug 9, 2016

@chiragmongia do an upgrade first. I think that solved it for me

@felixhao28
Copy link

Related issue here: browserify/browserify#1531

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

4 participants