2

I build my project with Electron. Its run on Nodejs. I compile this project with Electron-Packager. It's run, but when i move compiled folder, project won't run I get some path errors.

export function getSafeWPPath(): string {
     let home = app.getPath('home');
     home = path.resolve(home, ".SafeWP");
     if (!fs.existsSync(home)) {
         fs.mkdirSync(home);
     }
     return home;
 }

I get

Uncaught Exception:
TypeError: Cannot read property 'resolve' of undefined
   at getSafeWPPath

enter image description here

1 Answers1

1

its becuase it cannot find a path module. make sure you have added 'path' to dependencies instead of dev dependencies.

Amir Alam
  • 155
  • 1
  • 12