2015-02-08 111 views

回答

1

也许,这个链接和解决方案将为您有用:

1)https://github.com/hideo55/node-murmurhash3/issues/4

问题:

When I run the command sudo npm link your NPM is failing.

解决方案:

when I use --unsafe-perm=true this NPM works.

2)https://github.com/npm/npm/wiki/Troubleshooting#permission-error

Permission Error

npm ERR! code EPERM

npm ERR! code EACCES

Fix the permissions of your cache with sudo chown -R $(whoami) "$HOME/.npm". 
Try again with sudo. e.g. sudo npm install express -g. (You'll probably need to fix cache permissions afterwards, as above). 
Reinstall node so it doesn't require sudo. 
+0

--unsafe-perm = true为我工作,谢谢! – glambert 2015-02-21 08:07:38

0

EACCES错误代码意味着该进程没有权限读取目标目录/文件/写。正如包管理器常见的,这通常意味着模块不能安装到目标目录。

这可以通过以超级用户(sudo ...)的身份运行该命令来解决,但最好只修复文件权限,以便运行该命令的帐户具有对目标目录的必要权限。

作为附注,EACCES错误来自伟大的Linux本身 - 请参阅list of other error codes(或运行man errno)可能遇到的错误。

+0

嗨,该命令使用超级用户正在运行:“须藤NPM安装--save电子邮件模板”,并已尝试直接以root身份了。没有雪茄:-( – glambert 2015-02-09 14:21:10

+1

尝试用'--verbose'标志运行'npm install'命令,看看你能否从详细日志中学到一些有用的东西... – 2015-02-09 14:28:17

0

定义环境变量NODE_PATH这样:

export NODE_PARENT=${HOME}/node-v0.12.0 
export PATH=${NODE_PARENT}/bin:${PATH} # so executables are found 
export NODE_PATH=${NODE_PARENT}/lib/node_modules # so node can find modules 

./configure --prefix=${NODE_PARENT} 

从源头......,让你节点和NPM 为此安装时节点,并避免所有这些权限错误...然后安装模块,自己......无需根

npm install -g some-global-module