npm will not install express?

后端 未结 8 1025
臣服心动
臣服心动 2020-12-23 11:39

I currently have node.js version 0.8.8, and npm 1.1.59 installed.

Whenever I run:

$ npm install -g express

I get this in return:<

相关标签:
8条回答
  • 2020-12-23 12:09

    If you can't see nothing wrong with using sudo npm install -g package_name. And have the problem with typing a password you can always add yourself to sudoers files or to the same group that npm executable belongs to.

    And so to add yourself to sudoers for npm edit /etc/sudoers adding something like this to the bottom of the file:

    your_username  localhost=/usr/local/bin/npm
    

    Here is step by step guide on how to achieve that if you need more details.

    0 讨论(0)
  • 2020-12-23 12:11

    i got the same problem , This problem is caused because the .npm directory in your home directory was created with root privileges.

    use :

    $sudo npm install -g express
    
    0 讨论(0)
提交回复
热议问题