Electron JS install error - Error: EACCES: permission denied

后端 未结 4 1449
礼貌的吻别
礼貌的吻别 2021-01-14 07:00

getting error while installing ElectronJS,

Error:

Error: EACCES: permission denied, mkdir \'/usr/lib/node_modules/electron/.electron\'
4条回答
  •  遥遥无期
    2021-01-14 07:21

    I ran into a similar problem. I fixed it by changing folder permissions.

    Check the current folder permissions of the /usr/lib/node_modules directory by running the following command:

    ls -l /usr/lib | grep "node_modules

    Your output will probably be:

    drwxr-xr-x 3 root root {timestamp} node_modules

    Change the owner of the directory to the current user by running the following command:

    sudo chown -R current_username:current_username /usr/bin/node_modules

    Note - Do not run sudo with any npm command! More information here.

    Hope this Helps :)

提交回复
热议问题