Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Cannot find module 'chalk' #13

Closed
varjmes opened this issue Dec 16, 2014 · 23 comments
Closed

Cannot find module 'chalk' #13

varjmes opened this issue Dec 16, 2014 · 23 comments

Comments

@varjmes
Copy link

varjmes commented Dec 16, 2014

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!

@arthurvr
Copy link
Contributor

Confirmed here.

@lucalanca
Copy link
Contributor

+1 here

@arthurvr
Copy link
Contributor

PR #14.

@attiks
Copy link
Contributor

attiks commented Dec 16, 2014

Manual fix:

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

@lucalanca
Copy link
Contributor

@arthurvr you were faster than me 👍

@arthurvr
Copy link
Contributor

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

@addyosmani
Copy link
Owner

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?

@arthurvr
Copy link
Contributor

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

@addyosmani
Copy link
Owner

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?

@arthurvr
Copy link
Contributor

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

@addyosmani
Copy link
Owner

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

@arthurvr
Copy link
Contributor

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 ;-)

@addyosmani
Copy link
Owner

👍

@varjmes
Copy link
Author

varjmes commented Dec 16, 2014

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

@DTD1031
Copy link

DTD1031 commented Feb 1, 2016

interesting

@hussainwali74
Copy link

hussainwali74 commented Oct 2, 2017

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)

@localhost-rex
Copy link

Also experiencing this issue

@ghost
Copy link

ghost commented Jan 25, 2018

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

@leodutra
Copy link

leodutra commented Feb 5, 2018

Solution?

@ghost
Copy link

ghost commented Feb 19, 2018

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!

@vivekiyer114
Copy link

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

Operating System:- MacOS

@Turngait
Copy link

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

@gjvoit
Copy link

gjvoit commented Jul 11, 2020

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/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.