NPM won't install any package on Mac. New, clean build. `EACCES` & other errors

前端 未结 6 932
野性不改
野性不改 2021-02-07 15:32

I\'ve just rebuild my Mavericks (Mac OS X Version 9.4) machine from scratch. I am the administrator and only user of this machine.

  • I installed Git via their
6条回答
  •  礼貌的吻别
    2021-02-07 16:07

    EACCES is an error of not having access on doing an operation.

    Taken the line: npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/bower' we can see that npm was unable to create a directory in the given location.

    The reason is very likely that you are not running the command as super user. In fact, the error log is even suggesting that:

    npm ERR! Please try running this command again as root/Administrator.

    To run as administrator, you have to prefix those commands with sudo. That is:

    sudo npm install -g bower. You will be required to type in a password for security reasons.

提交回复
热议问题