Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing "Cannot find module 'find-npm-prefix'" error. #21829

Closed
lovep34 opened this issue Jul 16, 2018 · 6 comments
Closed

Showing "Cannot find module 'find-npm-prefix'" error. #21829

lovep34 opened this issue Jul 16, 2018 · 6 comments

Comments

@lovep34
Copy link

lovep34 commented Jul 16, 2018

Hello,

Node Version : v8.11.3

I am trying to install angular 6, but when I try to tun the command with NPM it throw the below error, I am not sure how to clear the "find-npm-prefix" error.

module.js:549 throw err; ^ Error: Cannot find module 'find-npm-prefix' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object.<anonymous> (C:\Users\love34\AppData\Roaming\npm\node_modules\npm\ lib\config\load-prefix.js:3:18) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3)

@jenilChristo
Copy link

Check your node environment variable and make sure your which npm and which node points to the right env path

@lovep34
Copy link
Author

lovep34 commented Jul 18, 2018

Hi @jenilChristo ,
Thanks for your reply!
I just tried it and it is showing below outtut, I have tried to reinstall the nodejs, but again it is showing same error.

Please help!

image

@jenilChristo
Copy link

Looks like you are on windows machine.which is supported only in UNIX based OS.You can use the variant where instead in windows.

@lovep34
Copy link
Author

lovep34 commented Jul 18, 2018

You are correct, here is the output with where

image

@bzoz
Copy link
Contributor

bzoz commented Jul 18, 2018

Looks like a broken npm installation. While where points to C:\Program Files\..., the error message indicates code from C:\Users\love34\AppData\Roaming\npm\node_modules\npm is used.

Try removing C:\Users\love34\AppData\Roaming\npm and npm-cache folders and reinstall Node.

@lovep34
Copy link
Author

lovep34 commented Jul 19, 2018

@bzoz you are correct, now it is working.

Thanks for your help.

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

No branches or pull requests

3 participants