juliangruber / downloads-folder

Get the local downloads folder, for all major platforms
32 stars 6 forks source link

[registry-js] Module parse failed: Unexpected character '�' from #15

Open moshfeu opened 3 years ago

moshfeu commented 3 years ago

There is an open issue on registry-js: https://github.com/desktop/registry-js/issues/190

ERROR in ./node_modules/registry-js/build/Release/registry.node 1:0 Module parse failed: Unexpected character '�' (1:0)

I just wanted to bring it to your attention

lemontree2000 commented 2 years ago

If you use it in electron,I ssuggest you add ”downloads-folder “ the wepback config externals, At the same time, find a way to add it to the · dependencies · field of "dist_electron \ bundled \ package. JSON"

dist_electron\bundled\package.json


  "dependencies": {
    "downloads-folder": "^3.0.1"
  }

webpack cofnig

// this is vue.config.js
chainWebpack(config) {
  config.externals({ "downloads-folder": 'require("downloads-folder")' });
  config.target("electron-renderer");
}

If you use Vue cli plugin electron builder , it has done the above for you, Hope to help you.