Closed kdipippo closed 1 week ago
I hit this issue as well and the proposed fix (adding #!/usr/bin/env node
) work for me. Thanks @kdipippo
We're going to be fixing this up and merging the project into https://github.com/avigoldman/caniemail after discussions with the owner of that package. The CLI was removed when the doiuseemail project was transferred to me, but we may reinstate it again in the future.
Summary of Issue
Running through the documentation, I get an "import: command not found" error that goes away when a shebang line is added to the start of
cli.js
. I'm creating this issue as I'm not sure wherecli.js
gets formed in this github repo. This repo is on versionv0.3.2
for its tagged releases while the npm package directory (and my walkthrough here) has0.4.1
available.But thank you for creating this tool! Now that I have it working, I'm excited to use this to lint my HTML email templates to shrink the amount of manual checking needed to see how they render.
I am not sure what other machines are affected by this issue, i.e. I'm not sure if I ran into this due to using a MacBook or because of Sonoma, etc.
Table of Contents
Project Setup
My
package.json
:My
myfile.html
Ran both commands for installing globally and locally:
My local versions of things:
I am using a MacBook Pro on Sonoma 14.5.
Current Behavior
Error I get when running the project as-is with local dependency:
Error I get when running the project as-is with global dependency:
Change Performed
I made the following update to
node_modules/doiuse-email/bin/cli.js
:I applied the same change to
/opt/homebrew/lib/node_modules/doiuse-email/bin/cli.js
where my global dependency is installed.My guess for this was based on another npm command line I use for linting that starts its own entry-point script file with that line as well: https://github.com/Redocly/redocly-cli/blob/7a496684fa67ec0dd3bbf1a8e7e1dac3ca446626/packages/cli/bin/cli.js#L1
Fixed Behavior
Locally calling the command now returns the results expected, as documented in the README.
Globally calling now also succeeds: