Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Cannot run nativefier #1535

Open
5 tasks done
AMajor-C opened this issue Jun 5, 2023 · 2 comments
Open
5 tasks done

Cannot run nativefier #1535

AMajor-C opened this issue Jun 5, 2023 · 2 comments
Labels

Comments

@AMajor-C
Copy link

AMajor-C commented Jun 5, 2023

Homework

Nativefier command

nativefier --help

Steps to reproduce

  1. npm install -g nativefier
  2. nativefier --help

Expected behavior

Listing help

Actual behavior

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\Admin\AppData\Roaming\npm\node_modules\nativefier\node_modules\axios\index.js
require() of ES modules is not supported.
require() of C:\Users\Admin\AppData\Roaming\npm\node_modules\nativefier\node_modules\axios\index.js from C:\Users\Admin\AppData\Roaming\npm\node_modules\nativefier\lib\helpers\helpers.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\Admin\AppData\Roaming\npm\node_modules\nativefier\node_modules\axios\package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1174:13)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (C:\Users\Admin\AppData\Roaming\npm\node_modules\nativefier\src\helpers\helpers.ts:6:1)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)

Debug info

No response

Nativefier version

nativefier@50.1.1

Node.js version

v12.16.1

npm version

6.13.4

OS

22H2 19045.2486

@AMajor-C AMajor-C added the bug label Jun 5, 2023
@Oqarshi
Copy link

Oqarshi commented Jul 20, 2023

it could be that ur npm is out dated.

try updating node.js

and reinstalling nativefier
like this

npm uninstall -g nativefier
npm install -g nativefier

@AMajor-C
Copy link
Author

it could be that ur npm is out dated.

try updating node.js

and reinstalling nativefier like this

npm uninstall -g nativefier npm install -g nativefier

unfortunately it didnt help

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants