Skip to content

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

Description

@lovep34

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)

Activity

  1. jenilChristo commented on Jul 17, 2018

    @jenilChristo

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

  2. lovep34 commented on Jul 18, 2018

    @lovep34
    Author

    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

  3. jenilChristo commented on Jul 18, 2018

    @jenilChristo

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

  4. lovep34 commented on Jul 18, 2018

    @lovep34
    Author

    You are correct, here is the output with where

    image

  5. bzoz commented on Jul 18, 2018

    @bzoz
    Contributor

    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.

  6. lovep34 commented on Jul 19, 2018

    @lovep34
    Author

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions