Skip to content
This repository has been archived by the owner on Dec 12, 2017. It is now read-only.

权限报错? #32

Closed
henryzp opened this issue May 17, 2016 · 5 comments
Closed

权限报错? #32

henryzp opened this issue May 17, 2016 · 5 comments

Comments

@henryzp
Copy link

henryzp commented May 17, 2016

npm的版本是3.9

image

直接输cooking -v也是报这个错。。

@QingWei-Li
Copy link
Contributor

最好不要用 sudo 安装 node,不然执行这种全局的工具都要加 sudo
解决方法是修改 node_modules 目录的权限为当前用户,或者用 nvm 之类的工具安装 node
#29

@henryzp
Copy link
Author

henryzp commented May 17, 2016

sudo chown -R zhangpu /usr/local/lib/node_modules/cooking

已经OK了。。

确认一下,是不是只要涉及到读写的,没有办法在工具中实现的对吧?一定要赋权限之后才行?

@QingWei-Li
Copy link
Contributor

不是

一开始你安装 node 使用 sudo 安装的,导致 npm 创建的目录 node_modules 是 root 权限。然后本地项目(用户创建的非 root 权限)要去执行 root 权限的 cooking 就报错了。要么以后都用 sudo 去执行

sudo cooking watch --allow-root

要么修改权限

@henryzp
Copy link
Author

henryzp commented May 17, 2016

@QingWei-Li 谢谢。。

@QingWei-Li
Copy link
Contributor

使用愉快

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants