如何在Linux中安装node-gyp? [英] How to install node-gyp in Linux?
本文介绍了如何在Linux中安装node-gyp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
user@user-VirtualBox:~/express$ npm install -g node-gyp
npm http GET https://registry.npmjs.org/node-gyp
npm http 200 https://registry.npmjs.org/node-gyp
npm http GET https://registry.npmjs.org/node-gyp/-/node-gyp-0.6.3.tgz
npm http 200 https://registry.npmjs.org/node-gyp/-/node-gyp-0.6.3.tgz
npm ERR! Could not create /usr/local/lib/node_modules/___node-gyp.npm
npm ERR! error installing node-gyp@0.6.3
npm ERR! Error: EACCES, permission denied '/usr/local/lib/node_modules'
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR!
npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "node-gyp"
npm ERR! cwd /home/user/express
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! message EACCES, permission denied '/usr/local/lib/node_modules'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/user/express/npm-debug.log
npm not ok
user@user-VirtualBox:~/express$
我正在尝试在系统上安装Node-gyp.我试图在具有linux 12.04 ubuntu OS的系统上安装.
What I am trying is install Node-gyp on a system. I tried to install on system that have linux 12.04 ubuntu OS.
有人知道如何设置安装node-gyp的权限.
Do someone know how to set permission for installing node-gyp.
感谢您的帮助.
推荐答案
npm install -g
为所有用户安装软件包.因此,您需要管理员权限才能安装它.试试
npm install -g
installs a package for all users. Therefore, you need administrator rights to install it. Try
sudo npm install -g node-gyp
这篇关于如何在Linux中安装node-gyp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文