Gulp - Error: cannot find module 'immutable'
See original GitHub issueThe Problem
Iβm currently using browser-sync as a gulp dev-dependency for an express.js app. Everything seems to work fine in a local version of this app but when I:
git clone
the reponpm install
npm start
ornodemon ./bin/www
gulp
Running gulp will give me an error that looks related to browser-sync
and immutable
.
Hereβs a truncated error (full errors near the end of the issue):
throw err;
^
Error: Cannot find module 'immutable'
...
(truncated for length)
...
When I look at the output from install browser-sync by itself, I can see that immutable
is installing successfully:
$ npm install browser-sync --save-dev
...
CXX(target)
Release/obj.target/bufferutil/src/bufferutil.o
browser-sync@2.2.2 node_modules/browser-sync
...
βββ immutable@3.6.3
...
Attempted Solutions
- Iβve tried deleting my
node_modules
and re-installing all dependencies withnpm install
but the error still persists. - In
package.json
, tried removing^
and~
from dependencies to lock-in versions for npm modules - (Probably unnecessary but) Rebuilt the app from scratch to see if the error would still persist, and it does. Hereβs the repo where I rebuilt it from scratch.
Full Console Output (errors, immutable-related)
Running npm install for browser-sync
$ npm install browser-sync --save-dev
npm WARN package.json brianhan-io-restart@1.0.0 No repository field.
> ws@0.5.0 install /Users/brianhan/Dev/sites/brianhan-io-restart/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
SOLINK_MODULE(target) Release/bufferutil.node: Finished
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
SOLINK_MODULE(target) Release/validation.node: Finished
> ws@0.4.31 install /Users/brianhan/Dev/sites/brianhan-io-restart/node_modules/browser-sync/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
browser-sync@2.2.2 node_modules/browser-sync
βββ async-each-series@0.1.1
βββ emitter-steward@0.0.1
βββ opn@1.0.1
βββ dev-ip@1.0.1
βββ immutable@3.6.3
βββ ua-parser-js@0.7.3
βββ browser-sync-client@1.0.2
βββ portscanner@1.0.0 (async@0.1.15)
βββ meow@3.1.0 (object-assign@2.0.0, minimist@1.1.0, camelcase-keys@1.0.0, indent-string@1.2.1)
βββ foxy@10.0.2 (cookie@0.1.2, meow@2.1.0, http-proxy@1.8.1)
βββ resp-modifier@2.0.1 (minimatch@2.0.1)
βββ easy-extender@2.2.0 (lodash@2.4.1)
βββ connect@3.3.4 (utils-merge@1.0.0, parseurl@1.3.0, debug@2.1.2, finalhandler@0.3.3)
βββ serve-index@1.6.2 (parseurl@1.3.0, batch@0.5.2, debug@2.1.2, http-errors@1.3.1, accepts@1.2.4, mime-types@2.0.9)
βββ serve-static@1.9.1 (utils-merge@1.0.0, escape-html@1.0.1, parseurl@1.3.0, send@0.12.1)
βββ glob-watcher@0.0.8 (gaze@0.5.1)
βββ eazy-logger@2.1.1 (tfunk@3.0.1, opt-merger@1.1.0)
βββ localtunnel@1.5.0 (debug@0.7.4, optimist@0.3.4, request@2.11.4)
βββ lodash@3.4.0
βββ socket.io@1.3.5 (debug@2.1.0, has-binary-data@0.1.3, socket.io-adapter@0.3.1, socket.io-parser@2.2.4, engine.io@1.5.1, socket.io-client@1.3.5)
βββ browser-sync-ui@0.4.9 (connect-history-api-fallback@0.0.5, angular-touch@1.3.14, angular-sanitize@1.3.14, angular-route@1.3.14, angular@1.3.14, weinre@2.0.0-pre-I0Z7U9OV)
When running gulp
$ gulp
throw err;
^
Error: Cannot find module 'immutable'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/brianhan/Dev/sites/brianhan-io-restart/node_modules/browser-sync/lib/hooks.js:4:20)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
My Repo
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Error: Cannot find module 'immutable' on existing project ...
npm WARN gatsby-source-filesystem@1.5.39 requires a peer of gatsby@^1.9.250 but none is installed. You must install peer dependencies yourself.
Read more >Immutable-ext Cannot find module - Stack Overflow
immutable-ext has immutable as a peer dependency. That means you have to install immutable by yourself.
Read more >immutable - npm
Introduction. Immutable data cannot be changed once created, leading to much simpler application development, no defensive copying, and enablingΒ ...
Read more >Migration | Yarn - Package Manager
Cannot find module [. ... Run npm install -g yarn to update the global yarn version to latest v1 ... There is no...
Read more >Node.js v19.3.0 Documentation
Features are marked as legacy rather than being deprecated if their use does no harm, and they are widely relied upon within the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
npm rm browser-sync && npm install browser-sync
The problem was with the immutable lib, which is now fixed. On Sun, 8 Mar 2015 at 06:17, William Huang notifications@github.com wrote:
I have problem with run node js
Start at Fri Dec 04 2015 module.js:339 throw err; ^
Error: Cannot find module βhttp-syncβ at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Object.<anonymous> (/home/visal/Downloads/influenceurs/INFLUENCEURS/influenceur.js:4:14) at Module._compile (module.js:435:26) at Object.Module._extensionsβ¦js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Function.Module.runMain (module.js:467:10)