npm install permission denied (macOS)

前端 未结 6 822
梦谈多话
梦谈多话 2021-02-07 15:08

To install a Bootstrap theme I want to run npm install. However I always receive a permission denied error.

I already tried nvm and then switched with

6条回答
  •  闹比i
    闹比i (楼主)
    2021-02-07 15:49

    Check permissions of your project root with ls -l /Users/Marc/Desktop/Dev/masterclass/. If the owner is not $USER, delete your node_modules directory, try changing the owner of that directory instead and run npm install again.

    cd /Users/Marc/Desktop/Dev
    rm -rf ./masterclass/node_mdoules/
    chown -R $USER ./masterclass/
    cd masterclass    
    npm install
    

提交回复
热议问题