Gulp Browser-sync Throwing Error module.js:471 cannot find ./lib/public/resume.js Windows 7
See original GitHub issueIssue details
Trying to run gulp task and browser-sync is throwing an error - halting the process. Tried npm cache clean, reverting back to previous versions of npm with no luck…
> gulp
module.js:471
throw err;
^
Error: Cannot find module './lib/public/resume'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Function.create (C:\test\node_modules\browser-sync\index.js:307:20)
at Object.<anonymous> (C:\test\gulpfile.js:23:44)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
resume.js is present in node_modules/browser-sync/lib/public
The same set up is on my colleague’s computer, but it works! I’ve been at this for several hours and not sure where else to look so I’m opening this issue.
Please specify which version of Browsersync, node and npm you’re running
- Browsersync [ 2.18.7 ]
- Node [ 6.9.4 ]
- Npm [ 4.1.2 ]
- Git Bash win32 x64
- prefix = "C:\Users\{myusername}\AppData\Roaming\npm
- node bin location C:\Program Files\nodejs\node.exe
- HOME = C:\Users{myusername}
- which npm = /c/Program Files/nodejs/npm
- which node = /c/Program Files/nodejs/node
- $echo NODE_PATH = n/a command not found
Affected platforms
- linux
- windows
- OS X
- freebsd
- solaris
- other (please specify which)
Browsersync use-case
- API
- Gulp
- Grunt
- CLI
gulpfile.js
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
gulp.task( 'browser-sync', function() {
browserSync.init({
server: './',
notify: {
styles: {
top: 'auto',
bottom: '0'
}
},
injectChanges: true
});
});
gulp.task( 'default', ['styles', 'js', 'browser-sync'], function() {
gulp.watch(html, reload);
gulp.watch(assets.scss, ['styles']);
gulp.watch(assets.js, ['js', reload]);
});
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Error: Cannot find module 'browser-sync' - Stack Overflow
To do that,. cd into the project directory and run npm install . Then try gulp serve . You can also try following...
Read more >Browsersync + Gulp.js
Browsersync makes your browser testing workflow faster by synchronising URLs, interactions and code changes across multiple devices.
Read more >Module BrowserSync is not available! You either misspelled ...
Issue details I am trying to use browser-sync inside a ghost template so I ... angular.js:138:11 Uncaught Error: [$injector:nomod] Module ...
Read more >browser-sync - npm
Start using browser-sync in your project by running `npm i browser-sync`. There are 2430 other projects in the npm registry using ...
Read more >How to set up Gulp 4, Bootstrap, Sass and BrowserSync for a ...
Gulp JS is an open source Javascript toolkit developed by Eric ... Step 1: Install Gulp, BrowserSync and Bootstrap as dependencies with NPM....
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
Update: I’m beginning to believe this issue is stemming from some kind of system settings, permissions, or symantec antivirus/firewall restrictions. Upon further testing. Browser-sync was able to be installed and run with the above gulp task in Safe Mode with Networking, but when running in Windows normal mode, that resume.js error is triggered. Please keep this issue open for now as I feel I am getting closer to the culprit. Will report back with what we find.
If it helps anyone, I had the same issue. I ended up deleting the project and running PowerShell as an Administrator then recreating the project and it worked first time. Hope that also helps (I didn’t have Symantec Endpoint Protection restrictions)