Netlify CLI netlify login issues - micro-api-client

Hey guys, I am struggling with an error I’m running into when trying to use the Netlify CLI. I can’t seem to figure what the issues is. Any help or guidance would be greatly appreciated.
Issue is below:

netlify-cli/8.0.11 darwin-x64 node-v14.11.0
Mac OS Big Sur 11.5.2

Installed the netlify-cli, and anytime I try to run ‘netlify login’ to connect to my account I get the following error:

SyntaxError: The requested module ‘micro-api-client’ is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
For example:
import pkg from ‘micro-api-client’;
const { JSONHTTPError, TextHTTPError } = pkg;
at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:21)
(node:3467) UnhandledPromiseRejectionWarning: file:///Users/mikepalazzo/.nvm/versions/node/v14.11.0/lib/node_modules/netlify-cli/node_modules/netlify/src/methods/response.js:1
import { JSONHTTPError, TextHTTPError } from ‘micro-api-client’
^^^^^^^^^^^^^

2 Likes

Hi @mpalazzo,

If you’re still seeing this, could you file this on the CLI repo:

But before you do that, please try this on a different network/device.

1 Like

Hey @mpalazzo, just ran into the same error.

Mine began when I attempted to upgrade node versions (I’m using nvm) to match what my project required. Not sure at what node v14 minor version netlify-cli stops throwing the error, but I know v14.15.0 works.

It feels like a work-around, but upgrading node and running npx netlify <command> got me up and running.

Hope this helps!

2 Likes

I also faced similar issue after upgrading netlify version , so I upgraded node version also ,and it resolved the issue.

1 Like

Thank you very much.
Yes, updating my node version to the latest lts resolved the issue.

1 Like

Thanks so much for coming back and confirming! Glad everything is working now :netliconfetti: