question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI broken since version 8

See original GitHub issue

Happens both when installed locally, as well as when using npx.

➜  min npx minify test.js 
Need to install the following packages:
  minify
Ok to proceed? (y) 
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/sgtlambda/.npm/_npx/cfbbf1728dde0171/node_modules/minify/' is not supported resolving ES modules imported from /Users/sgtlambda/.npm/_npx/cfbbf1728dde0171/node_modules/minify/bin/minify.js
    at new NodeError (node:internal/errors:370:5)
    at finalizeResolution (node:internal/modules/esm/resolve:317:17)
    at moduleResolve (node:internal/modules/esm/resolve:756:10)
    at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:867:11)
    at Loader.resolve (node:internal/modules/esm/loader:89:40)
    at Loader.getModuleJob (node:internal/modules/esm/loader:242:28)
    at Loader.import (node:internal/modules/esm/loader:177:28)
    at importModuleDynamically (node:internal/modules/esm/translators:116:35)
    at exports.importModuleDynamicallyCallback (node:internal/process/esm_loader:30:14)
    at uglifyFiles (file:///Users/sgtlambda/.npm/_npx/cfbbf1728dde0171/node_modules/minify/bin/minify.js:85:20) {
  code: 'ERR_UNSUPPORTED_DIR_IMPORT',
  url: 'file:///Users/sgtlambda/.npm/_npx/cfbbf1728dde0171/node_modules/minify/'
}

Replacing minify with minify@7 in the command above makes it work.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
coderaisercommented, Oct 5, 2021

Thank you! Landed in v8.0.2 🎉 . Is it works for you?

0reactions
takayukiodacommented, Oct 8, 2021

@coderaiser thanks! it worked as expected 👍🏽

% cat << EOT > hello.js    
const hello = 'world';

for (let i = 0; i < hello.length; i++) {
    console.log(hello[i]);
}
EOT

% npx minify@8.0.2 hello.js
const hello="world";for(let l=0;l<hello.length;l++)console.log(hello[l]);
Read more comments on GitHub >

github_iconTop Results From Across the Web

CLI V.8 is not working under M1 · Issue #10193 · aws-amplify ...
I originally installed some v8 version a few weeks back and all was fine until there was an upgrade. After running amplify upgrade,...
Read more >
Troubleshooting AWS CLI errors - AWS Command Line Interface
General troubleshooting to try firstCommand not found errorsThe "aws --version" command returns a different version than you installedThe "aws --version" ...
Read more >
command line tools getting broken/… | Apple Developer Forums
Hi everyone! Since quite a while (I think it may have started with Catalina) I frequently run into issues for example with npm/***...
Read more >
Apache Commons CLI Release Notes
Release 1.3 – 2015-05-09. Type, Changes, By. Fix, Fixed broken Javadoc links on Introduction page. Fixes CLI-248. djones.
Read more >
Cannot determine versions of "@angular/cli" local installation ...
After this installation, when I put command ng serve to running project, the return by the console is: Cannot determine versions of "@angular/ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found