{"action":"created","issue":{"url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/502","labels_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/502/comments","events_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/502/events","html_url":"https://github.com/BrowserSync/browser-sync/issues/502","id":60234059,"number":502,"title":"Gulp - Error: cannot find module 'immutable'","user":{"login":"thisisbrianhan","id":4185382,"avatar_url":"https://avatars.githubusercontent.com/u/4185382?v=3","gravatar_id":"","url":"https://api.github.com/users/thisisbrianhan","html_url":"https://github.com/thisisbrianhan","followers_url":"https://api.github.com/users/thisisbrianhan/followers","following_url":"https://api.github.com/users/thisisbrianhan/following{/other_user}","gists_url":"https://api.github.com/users/thisisbrianhan/gists{/gist_id}","starred_url":"https://api.github.com/users/thisisbrianhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thisisbrianhan/subscriptions","organizations_url":"https://api.github.com/users/thisisbrianhan/orgs","repos_url":"https://api.github.com/users/thisisbrianhan/repos","events_url":"https://api.github.com/users/thisisbrianhan/events{/privacy}","received_events_url":"https://api.github.com/users/thisisbrianhan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-08T00:40:35Z","updated_at":"2015-04-29T18:06:10Z","closed_at":"2015-03-08T07:44:06Z","body":"# The Problem\r\nI'm currently using browser-sync as a gulp dev-dependency for an express.js app.\r\nEverything seems to work fine in a local version of this app but when I: \r\n\r\n- `git clone` the [repo](https://github.com/thisisbrianhan/brianhan.io)\r\n- `npm install` \r\n- `npm start` or `nodemon ./bin/www`\r\n- `gulp`\r\n\r\nRunning gulp will give me an error that looks related to `browser-sync` and `immutable`. \r\nHere's a truncated error (full errors near the end of the issue):\r\n```\r\nthrow err;\r\n      ^\r\nError: Cannot find module 'immutable'\r\n...\r\n(truncated for length)\r\n...\r\n```\r\nWhen I look at the output from install browser-sync by itself, I can see that `immutable` is installing successfully:\r\n\r\n```\r\n$ npm install browser-sync --save-dev\r\n```\r\n```\r\n...\r\nCXX(target)\r\nRelease/obj.target/bufferutil/src/bufferutil.o\r\nbrowser-sync@2.2.2 node_modules/browser-sync\r\n...\r\n├── immutable@3.6.3\r\n...\r\n```\r\n# Attempted Solutions\r\n\r\n- I've tried deleting my `node_modules` and re-installing all dependencies with `npm install` but the error still persists.\r\n\r\n- In `package.json`, tried removing `^` and `~` from dependencies to lock-in versions for npm modules\r\n\r\n- (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](https://github.com/thisisbrianhan/brianhan-io-restart). \r\n\r\n# Full Console Output (errors, immutable-related)\r\n\r\n## Running npm install for browser-sync\r\n\r\n```\r\n$ npm install browser-sync --save-dev\r\n```\r\n```\r\nnpm WARN package.json brianhan-io-restart@1.0.0 No repository field.\r\n\r\n> 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\r\n> (node-gyp rebuild 2> builderror.log) || (exit 0)\r\n\r\n  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o\r\n  SOLINK_MODULE(target) Release/bufferutil.node\r\n  SOLINK_MODULE(target) Release/bufferutil.node: Finished\r\n  CXX(target) Release/obj.target/validation/src/validation.o\r\n  SOLINK_MODULE(target) Release/validation.node\r\n  SOLINK_MODULE(target) Release/validation.node: Finished\r\n\r\n> 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\r\n> (node-gyp rebuild 2> builderror.log) || (exit 0)\r\n\r\n  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o\r\nbrowser-sync@2.2.2 node_modules/browser-sync\r\n├── async-each-series@0.1.1\r\n├── emitter-steward@0.0.1\r\n├── opn@1.0.1\r\n├── dev-ip@1.0.1\r\n├── immutable@3.6.3\r\n├── ua-parser-js@0.7.3\r\n├── browser-sync-client@1.0.2\r\n├── portscanner@1.0.0 (async@0.1.15)\r\n├── meow@3.1.0 (object-assign@2.0.0, minimist@1.1.0, camelcase-keys@1.0.0, indent-string@1.2.1)\r\n├── foxy@10.0.2 (cookie@0.1.2, meow@2.1.0, http-proxy@1.8.1)\r\n├── resp-modifier@2.0.1 (minimatch@2.0.1)\r\n├── easy-extender@2.2.0 (lodash@2.4.1)\r\n├── connect@3.3.4 (utils-merge@1.0.0, parseurl@1.3.0, debug@2.1.2, finalhandler@0.3.3)\r\n├── 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)\r\n├── serve-static@1.9.1 (utils-merge@1.0.0, escape-html@1.0.1, parseurl@1.3.0, send@0.12.1)\r\n├── glob-watcher@0.0.8 (gaze@0.5.1)\r\n├── eazy-logger@2.1.1 (tfunk@3.0.1, opt-merger@1.1.0)\r\n├── localtunnel@1.5.0 (debug@0.7.4, optimist@0.3.4, request@2.11.4)\r\n├── lodash@3.4.0\r\n├── 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)\r\n└── 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)\r\n```\r\n\r\n## When running gulp\r\n\r\n```\r\n$ gulp\r\n```\r\n```\r\nthrow err;\r\n      ^\r\nError: Cannot find module 'immutable'\r\nat Function.Module._resolveFilename (module.js:336:15)\r\nat Function.Module._load (module.js:278:25)\r\nat Module.require (module.js:365:17)\r\nat require (module.js:384:17)\r\nat Object.<anonymous> (/Users/brianhan/Dev/sites/brianhan-io-restart/node_modules/browser-sync/lib/hooks.js:4:20)\r\nat Module._compile (module.js:460:26)\r\nat Object.Module._extensions..js (module.js:478:10)\r\nat Module.load (module.js:355:32)\r\nat Function.Module._load (module.js:310:12)\r\nat Module.require (module.js:365:17)\r\n```\r\n\r\n# [My Repo](https://github.com/thisisbrianhan/brianhan-io-restart)\r\n\r\n- [gulpfile.js](https://github.com/thisisbrianhan/brianhan-io-restart/blob/master/gulpfile.js)\r\n- [package.json](https://github.com/thisisbrianhan/brianhan-io-restart/blob/master/package.json)\r\n- [node_modules/browser-sync](https://github.com/thisisbrianhan/brianhan-io-restart/tree/master/node_modules/browser-sync)\r\n"},"comment":{"url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/comments/97524645","html_url":"https://github.com/BrowserSync/browser-sync/issues/502#issuecomment-97524645","issue_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/502","id":97524645,"user":{"login":"shakyShane","id":1643522,"avatar_url":"https://avatars.githubusercontent.com/u/1643522?v=3","gravatar_id":"","url":"https://api.github.com/users/shakyShane","html_url":"https://github.com/shakyShane","followers_url":"https://api.github.com/users/shakyShane/followers","following_url":"https://api.github.com/users/shakyShane/following{/other_user}","gists_url":"https://api.github.com/users/shakyShane/gists{/gist_id}","starred_url":"https://api.github.com/users/shakyShane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shakyShane/subscriptions","organizations_url":"https://api.github.com/users/shakyShane/orgs","repos_url":"https://api.github.com/users/shakyShane/repos","events_url":"https://api.github.com/users/shakyShane/events{/privacy}","received_events_url":"https://api.github.com/users/shakyShane/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T18:06:09Z","updated_at":"2015-04-29T18:06:09Z","body":"The immutable lib published a broken version. You should reinstall to fix "}}