question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module 'node_modules/is-buffer/index.js' from ...

See original GitHub issue
$ cat buf.js 
module.exports = function (b) { return Buffer.isBuffer(b) }
$ npm i browserify
...
$ ./node_modules/.bin/browserify buf.js 
Error: Cannot find module 'node_modules/is-buffer/index.js' from '/home/kirill/tmp'
    at /home/kirill/tmp/node_modules/resolve/lib/async.js:46:17
    at process (/home/kirill/tmp/node_modules/resolve/lib/async.js:173:43)
    at ondir (/home/kirill/tmp/node_modules/resolve/lib/async.js:188:17)
    at load (/home/kirill/tmp/node_modules/resolve/lib/async.js:69:43)
    at onex (/home/kirill/tmp/node_modules/resolve/lib/async.js:92:31)
    at /home/kirill/tmp/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:82:15)
$ vim buf.js
$ cat buf.js
;(function () { new Buffer(0) })()
module.exports = function (b) { return Buffer.isBuffer(b) }
$ ./node_modules/.bin/browserify buf.js 
(function e(t,n,r){function s(o, ... // ok

Related: https://github.com/substack/node-browserify/issues/1228

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
goto-bus-stopcommented, Feb 28, 2018

This should be fixed in insert-module-globals@7.0.2; do npm update to get it!

2reactions
MirFahad58commented, Feb 19, 2020

Just do this => npm install is-buffer --save

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected token ILLEGAL - Stack Overflow
I tried updating and reinstalling socket.io now I'm getting this error. C:\MY-APP\dataService>node dataAPI.js { [Error: Cannot find module '../ ...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
you're trying to import an item from a module you don't have installed in your project directory; you're importing some things from an...
Read more >
require.resolve "Error: Cannot find module" but ... - Reddit
resolve "Error: Cannot find module" but module exists in node_modules folder. this is all I'm trying to do require.resolve("stream ...
Read more >
Using node modules with njs - Nginx.org
This article describes ways to reuse Node.js code in njs. ... code.js Thrown: Error: Cannot find module "./static.js" at require (native) at main...
Read more >
node.js - module - iTecNote
Node.js – Error: Cannot find module './is-buffer' ... is-buffer is installed. ... ket.io-adapter\node_modules\socket.io-parser\index.js:11:13) at Module.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found