addyosmani/a11y

Cannot find module 'chalk'

Closed this issue ยท 23 comments

Howdy! This looks like an awesome tool, thank you!

I installed the module npm install -g a11y and it installed without issue.
However when I tried to run it: a11y http://www.google.com

I got the following:

module.js:340 throw err; ^ Error: Cannot find module 'chalk' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/usr/local/lib/node_modules/a11y/cli.js:7:13) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10)

I tried running npm cache clean which I found after a few google searches but it did not work.
Not sure if this is specific to me or is a wider problem.

Sorry to post an issue so quickly after you released it to the world!

Confirmed here.

+1 here

Manual fix:

npm install chalk
npm install each-async
npm install indent-string

@arthurvr you were faster than me ๐Ÿ‘

@addyosmani Might be worth to put out a patch release for this. Without the module is useless for now.

Thanks for the PR. I just pushed out a patch release which should include the fix for this. Confirmed working on my machine - does it work for others now?

Oh. Needs 'each-async' too...

Landed. I'm going to give this a few before pushing another patch release (had hoped Travis would catch any issues like this during testing - doh!).

Could folks verify master is working for them before we cut another a11y?

We'il need indent-string too right? It's used in cli.js, so...

Landed that one too. I think it should be good now. Will keep this open a little longer for others to test master.

had hoped Travis would catch any issues like this during testing - doh!

Just a randomly upcoming though: but more tests here and there may be welcome then ;-)

๐Ÿ‘

You all work fast! Thank you all.
It's working for me and it is awesome.

interesting

Hello I recently updated npm and node and I tried to install the angular cli but Now nothing works even simple generate command on the angular cli doesn't work

I have tried all the steps you guys mentioned as the cure:
`npm install chalk

npm install each-async

npm-install easy-async

npm install indent-string`
please help

$ ng g c compon
module.js:529
throw err;
^

Error: Cannot find module 'chalk'
at Function.Module._resolveFilename (module.js:527:15)
at Function.Module._load (module.js:476:23)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\hussain\AppData\Roaming\npm\node_modules@angular\cli\models\config.js:5:15)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)

Also experiencing this issue

Have you been able to find a solution pls? I have been struggling to fix this all morning.

Solution?

Well, sort of.
Duplicated my codebase, wiped by mac clean of any node.js/npm traces i.e. all installations and cache.
Then installed an older, more stable version of Node.js.
Slowly but surely, it all worked out. But now I double check my code a billion times before I build any projects (PTSD if you will).
Good luck!

what's final solution for this ?
Please help, i am facing the same issue.

Operating System:- MacOS

I had the same problem. I used an 'npm i' and then everything started.

FWIW, I just had to upgrade node. This did not fix the yarn issue, but updating to the latest NPM/Node combo got the npx script working for me.

Edit, adding means by which I installed node: https://nodejs.org/en/