BrowserSync / browser-sync

Keep multiple browsers & devices in sync when building websites. https://browsersync.io
https://discord.gg/2d2xUThp
Apache License 2.0
12.18k stars 756 forks source link

NPM Missing Peer Dependency #1837

Open JonSmart opened 3 years ago

JonSmart commented 3 years ago

Issue details

When including the NPM module browser-sync@2.26.13 in one of our projects we see the error:

npm ERR! peer dep missing: bufferutil@^4.0.1, required by ws@7.4.2
npm ERR! peer dep missing: utf-8-validate@^5.0.2, required by ws@7.4.2

Working through NPM trial this boils down to the browser-sync-ui project and the package.json line: "socket.io-client": "^2.0.4",. this means that the library is now including socket.io-client@2.4.0 it previously used to link socket.io-client@2.3.1. This change alone causes the issue.

Steps to reproduce/test case

It should be reproducible by adding this lib to a blank project as a dependency, running npm install followed by npm ls.

Please specify which version of Browsersync, node and npm you're running

Affected platforms

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

...
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');

module.exports = merge(common, {
  mode: 'development',

  devtool: 'inline-source-map',

  plugins: [
    new BrowserSyncPlugin({
      proxy: config.url,
      files: [
          '**/*.php'
      ],
      reloadDelay: 0,
      injectCss: true
    })
  ]
});
JonSmart commented 3 years ago

Confirmed with a blank project no other elements:

npm ERR! peer dep missing: bufferutil@^4.0.1, required by ws@7.4.2
npm ERR! peer dep missing: utf-8-validate@^5.0.2, required by ws@7.4.2
JonSmart commented 3 years ago

Looks like a PR has been raised already by Dependabot. #1836

Andres6936 commented 3 years ago

Resolve with 5aca6956f25f7c076a89cd248e992f476f4e3f68?