Skip to content
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

Cannot find module 'uuid/v4' from 'Utils.js' #1020

Closed
ryanve opened this issue Jul 5, 2017 · 6 comments · Fixed by plangrid/enzyme#1
Closed

Cannot find module 'uuid/v4' from 'Utils.js' #1020

ryanve opened this issue Jul 5, 2017 · 6 comments · Fixed by plangrid/enzyme#1

Comments

@ryanve
Copy link

ryanve commented Jul 5, 2017

With enzyme@2.9.1and uuid@3.1.0 I get this require error. It seems likely that this relates to #1001 and #998. We are getting this error in multiple projects. cc @lencioni

Cannot find module 'uuid/v4' from 'Utils.js'

npm ls uuid

├─┬ babel-cli@6.24.1
│ └─┬ chokidar@1.7.0
│   └─┬ fsevents@1.1.1
│     └─┬ node-pre-gyp@0.6.33
│       └─┬ request@2.79.0
│         └── uuid@3.0.1
├─┬ enzyme@2.9.1
│ └── uuid@3.1.0
├─┬ gulp-imagemin@2.4.0
│ └─┬ imagemin@4.0.0
│   ├─┬ buffer-to-vinyl@1.1.0
│   │ └── uuid@2.0.3
│   └─┬ imagemin-optipng@4.3.0
│     └─┬ exec-buffer@2.0.1
│       └─┬ tempfile@1.1.1
│         └── uuid@2.0.3  deduped
└─┬ node-sass@3.13.1
  └─┬ request@2.81.0
    └── uuid@3.0.1

If I manually change the Utils.js file from require('uuid/v4') to require('uuid').v4 then it works.

@ljharb
Copy link
Member

ljharb commented Jul 5, 2017

I'm not sure why https://unpkg.com/uuid@3.1.0/v4.js wouldn't work if it's truly at v3.1.0. Can you verify that node_modules/enzyme/node_modules/uuid/v4.js exists, and that node_modules/enzyme/node_modules/uuid/package.json is at v3.1.0?

@ryanve
Copy link
Author

ryanve commented Jul 5, 2017

I'm not sure why either. Yes the v4 file exists and that package path is v3.1.0

@ryanve
Copy link
Author

ryanve commented Jul 5, 2017

I confirmed this same error on node 7.10.0 and 8.1.3 and on npm 4.2.0 and npm 5.0.3

@kouhin
Copy link

kouhin commented Jul 7, 2017

Same error!
Old version of uuid may be pinned in node_modules and will be used by webpack or other bundle tools, although new version is installed in enzyme/node_modules.
I fixed this error by npm install uuid --save to replace the old version in node_modules.

@ryanve
Copy link
Author

ryanve commented Jul 11, 2017

Cool same we're now using npm install uuid@^3.1 --save-dev to fix this error on 3 projects that use enzyme@2.9.1. All 3 use npm@^5.2 as of today. 2 use webpack and 1 uses rollup.

@ljharb
Copy link
Member

ljharb commented Sep 26, 2017

I don't think this is relevant any more now that we're on v3.

@ljharb ljharb closed this as completed Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants