Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node-sass/build'

前端 未结 7 812
被撕碎了的回忆
被撕碎了的回忆 2021-01-31 20:31

I am trying to run angular application and execute ng serve command then show

Error: Cannot find module \'node-sass\'.

7条回答
  •  孤独总比滥情好
    2021-01-31 21:05

    On Reply :-

    Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node-sass/build'
    Ask Question
    

    Solution :-

    You need to change ownership of node_modules, because you use sudo npm install -g node-sass so its ownership set to root,

    To change ownership to current user as group -

    sudo chown -R root:YOUR_USERNAME /usr/local/lib/node_modules/
    
    sudo chmod -R 775 /usr/local/lib/node_modules/
    

    And never use sudo for npm related query.

提交回复
热议问题