NPM Error : Error: EROFS: read-only file system, mkdir '/npm'

后端 未结 1 1265
梦如初夏
梦如初夏 2021-01-25 16:52

I created an index.js, index.html and package.json file and I wanted to add express. When I write \'npm install express\' in the terminal, I\'m getting the error below. So far,

相关标签:
1条回答
  • 2021-01-25 17:51

    The error means that you have no permission to install anything with npm at the path /npm.
    To verify this run npm root -g. This should return /npm.

    Note that /npm ist not the default installation path on MacOS (see https://stackoverflow.com/a/35638528/1754076).

    Checkout your npm configuration file and change the default installation path to something where you do have write access. You can also use npm itself to change the default installation path.

    0 讨论(0)
提交回复
热议问题