EEXIST: file already exists | @ngx-cache
See original GitHub issueI’m submitting a … (check one with “x”)
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Support request => <!-- Please check the repository for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
Current behavior
When running in production SSR mode, ngx-cache fails on second load. It looks like it tries to create the .cache folder twice, and fails:
Error: EEXIST: file already exists, mkdir '/Users/foo/bar/.cache'
at Object.fs.mkdirSync (fs.js:874:3)
at new FsStorageService (/Users/foo/bar/node_modules/@ngx-cache/fs-storage/bundles/ngx-cache-fs-storage.umd.js:131:20)
at _createClass (/Users/foo/bar/node_modules/@angular/core/bundles/core.umd.js:20740:24)
at _createProviderInstance (/Users/foo/bar/node_modules/@angular/core/bundles/core.umd.js:20712:30)
at resolveNgModuleDep (/Users/foo/bar/node_modules/@angular/core/bundles/core.umd.js:20676:25)
at NgModuleRef_.get (/Users/foo/bar/node_modules/@angular/core/bundles/core.umd.js:21384:20)
at new FsCacheService (/Users/foo/bar/node_modules/@ngx-cache/platform-server/bundles/ngx-cache-platform-server.umd.js:41:39)
at _createClass (/Users/foo/bar/node_modules/@angular/core/bundles/core.umd.js:20742:24)
at _createProviderInstance (/Users/foo/bar/node_modules/@angular/core/bundles/core.umd.js:20712:30)
at resolveNgModuleDep (/Users/foo/bar/node_modules/@angular/core/bundles/core.umd.js:20676:25)
Expected/desired behavior
The expectation is that the cache services should check to see if the folder exists before trying to recreate it. This error breaks everything and shows in the browser.
Minimal reproduction of the problem with instructions
- Checkout the latest ng-seed/universal.
- Use
npm run start:ssr:prod
to start on localhost:4000
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:5
Top Results From Across the Web
EEXIST: file already exists | @ngx-cache · Issue #631 - GitHub
The expectation is that the cache services should check to see if the folder exists before trying to recreate it. This error breaks...
Read more >Angular CLI ng new error EEXIST: file already exists Windows ...
I have uninstalled and re-installed NodeJS and npm and angular CLI. I have force cleared my npm cache (npm cache clear --force); I...
Read more >docker npm err! tracker "idealtree" already exists - You.com
Tracker "idealTree" already exists while creating the Docker image for Node project ... clear the cache and do a npm i again with...
Read more >Unable to setup stencil-cli - BigCommerce Support
EEXIST : file already exists, cmd shim 'C:\Users\junaidahmed\AppData\Roaming\npm\node_modules\@bigcommerce\stencil-cli\bin\stencil' ...
Read more >Sep 09 2019 07:42 UTC - angular/angular - Gitter
So I clone clean source from ngx-admin and put my code one by one until ... An unhandled exception occurred: EEXIST: file already...
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
there is bug in XpFsStorageService use
if (!stat.isDirectory()) {
notif (!stat.hasOwnProperty('isDirectory')) {
workaround can by done by own implementation of storageService https://gist.github.com/meatfly/baff02d8004802a870b77171f0b3f6e0
and than use in app.server.module.ts
I still have this error
Event with your
XpFsStorageService
😕