-
Notifications
You must be signed in to change notification settings - Fork 48.6k
Multiple Copies of react installed #8026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've found this is common when modules have React as a dependency rather than a peerDependency in the npm package. If you're using webpack, I've got around this by creating an alias, perhaps you can do something similar in Gulp.
|
Awesome that helped.. Just sharing some ref for others Thanks. |
Also please file issues in such libraries and gently ask them to use |
For those who do not want to install any other packages for resolving. Configure a require key in the browserify object and that will take care of the error browserify({
entries: path,
require: ['react', 'react-dom'] // <- this bit here
})
.on("error", function(err) {
this.emit('end');
})
.transform("babelify", {presets: ["es2015", "react"]})
.bundle()
.pipe(source(fileName))
.pipe(buffer())
.pipe(gulpif(params.env === 'prod', uglify()))
.pipe(gulp.dest('./web/build/js')); |
I am using a few react components made by various libraries like material ui and i get this message
on doing
npm ls react
i can see only one version of react installed. I am using gulp and browserify for my build process. Any idea how i can solve this?The text was updated successfully, but these errors were encountered: