Hi, I have following issue in browser build:
ERROR in ./node_modules/faker/lib/locales.js
Module not found: Error: Cannot find file: 'index.js' does not match the corresponding name on disk: './node_modules/faker/lib/locales/en_AU_ocker/en_au_ocker'.
@ ./node_modules/faker/lib/locales.js 9:25-57
@ ./node_modules/faker/index.js
everything is ok in node env, but crashed for browser build.
ENV:
as-MBP-3:tmp a$ git clone https://github.com/Marak/faker.js
Cloning into 'faker.js'...
remote: Enumerating objects: 64, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 8451 (delta 33), reused 12 (delta 2), pack-reused 8387
Receiving objects: 100% (8451/8451), 13.17 MiB | 6.22 MiB/s, done.
Resolving deltas: 100% (4735/4735), done.
as-MBP-3:tmp a$ cd faker.js/
as-MBP-3:faker.js a$ npm install
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Fixed a prototype pollution security issue in 4.1.0, please upgrade to ^4.1.1 or ^5.0.1.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
> [email protected] install /Users/a/dev/tmp/faker.js/node_modules/fsevents
> node install.js
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
> [email protected] postinstall /Users/a/dev/tmp/faker.js/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: google-closure-compiler-linux@^20181008.0.0 (node_modules/google-closure-compiler/node_modules/google-closure-compiler-linux):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"x64,x86"} (current: {"os":"darwin","arch":"x64"})
added 1158 packages from 935 contributors and audited 1162 packages in 24.391s
found 7 vulnerabilities (3 low, 2 moderate, 2 high)
run `npm audit fix` to fix them, or `npm audit` for details
as-MBP-3:faker.js a$ npm run browser
> [email protected] browser /Users/a/dev/tmp/faker.js
> gulp browser
[09:48:00] Using gulpfile ~/dev/tmp/faker.js/gulpfile.js
[09:48:00] Starting 'browser'...
[09:48:06] Finished 'browser' after 5.23 s
as-MBP-3:faker.js a$
I ran the steps required to clone a clean version and run the browser build and our systems seem to disagree.
Closing for now unless someone can provide additional proof or details.
@Marak I stumbled to this error after upgrading to 5.1.0.
Cannot find file: 'index.js' does not match the corresponding name on disk: '...\node_modules\faker\lib\locales\en_AU_ocker\en_au_ocker'.
If I rename the en_au_ocker folder to en_AU_ocker in ...\node_modules\faker\lib\locales\ it works, because in node_modules\faker\lib\locales\locales.js it is required as require('./locales/en_AU_ocker')
@szmarci check the repository. The directory has the correct name. What most likely happened is that you checked out this directory by using small letters. Ntfs cannot tell git the difference hence git for windows default setup ignores case changes. So no matter how you ended up with that wrong name, git for windows won鈥檛 change it by default. Since there might be other case changes your clone is unaware of I鈥檇 suggest to reclone the repository.
Sent with GitHawk
I had the same issue on macOS upgrading from Faker v4.1.0 to v5.1.0 - its file system is also case insensitive by default. Yarn must have installed the package over the top of the old one, leaving the file system with the lowercase directory name but new, changed JS. The solution is to either rename the en_au_ocker directory to en_AU_ocker or just reinstall your project with a removal of node_modules or faker's top-level directory.
Most helpful comment
I had the same issue on macOS upgrading from Faker v4.1.0 to v5.1.0 - its file system is also case insensitive by default. Yarn must have installed the package over the top of the old one, leaving the file system with the lowercase directory name but new, changed JS. The solution is to either rename the
en_au_ockerdirectory toen_AU_ockeror just reinstall your project with a removal ofnode_modulesorfaker's top-level directory.