You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use trough npx and sadly found out that the module can not be run by it since it is and ES module.
Reproducing
When I run it I get the flowing error
npx npm-name-cli @fluid
npx: installed 286 in 33.964s
Cannot use import statement outside a module
(node:3732) Warning: require() of ES modules is not supported.
require() of /home/rpt/.npm/_npx/3732/lib/node_modules/npm-name-cli/cli.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 cli.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/rpt/.npm/_npx/3732/lib/node_modules/npm-name-cli/package.json.
Versions
I'm using node 12.14 and npm 6.13.4 on arch and zsh to reproduce it.
I guess the module version is the latest in npx, which to me seems to be 4.0.1.
Suggestions
From the error I'm guessing it could be done by simply changing the cli file extension from .js to .cjs, but I'm not that familiar with this kind of issue.
I'm willing to help and even try to open a PR if you are open to it.
Thank again for the amazing OSS you do!
The text was updated successfully, but these errors were encountered:
Context
Hey @sindresorhus thank you for the lib!
I was trying to use trough npx and sadly found out that the module can not be run by it since it is and ES module.
Reproducing
When I run it I get the flowing error
Versions
I'm using node 12.14 and npm 6.13.4 on arch and zsh to reproduce it.
I guess the module version is the latest in npx, which to me seems to be 4.0.1.
Suggestions
From the error I'm guessing it could be done by simply changing the cli file extension from .js to .cjs, but I'm not that familiar with this kind of issue.
I'm willing to help and even try to open a PR if you are open to it.
Thank again for the amazing OSS you do!
The text was updated successfully, but these errors were encountered: