在Ubuntu全局安装express报错:Error: EACCES, mkdir '/usr/lib/node_modules/express'的解决办法
$ npm install -g express
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules/express'
npm ERR! { [Error: EACCES, mkdir '/usr/lib/node_modules/express']
npm ERR! errno: ,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/lib/node_modules/express',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/lib/node_modules/express',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR! '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
npm ERR! 'Object.oncomplete (fs.js:108:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator. npm ERR! System Linux 4.4.--generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "express"
npm ERR! cwd /home/zmj97
npm ERR! node -v v0.10.37
npm ERR! npm -v 1.4.
npm ERR! path /usr/lib/node_modules/express
npm ERR! fstream_path /usr/lib/node_modules/express
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno
npm ERR! stack Error: EACCES, mkdir '/usr/lib/node_modules/express'
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js::
npm ERR! fstream_stack /usr/lib/node_modules/npm/node_modules/mkdirp/index.js::
npm ERR! fstream_stack Object.oncomplete (fs.js::)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/zmj97/npm-debug.log
npm ERR! not ok code
在全局安装时报错,提示“Please try running this command again as root/Administrator.”,
加上sudo即可。
$ sudo npm install -g express
[sudo] password for zmj97:
express@4.14. /usr/lib/node_modules/express
├── escape-html@1.0.
├── array-flatten@1.1.
├── utils-merge@1.0.
├── cookie-signature@1.0.
├── merge-descriptors@1.0.
├── fresh@0.3.
├── methods@1.1.
├── path-to-regexp@0.1.
├── vary@1.1.
├── encodeurl@1.0.
├── range-parser@1.2.
├── parseurl@1.3.
├── etag@1.7.
├── content-type@1.0.
├── cookie@0.3.
├── content-disposition@0.5.
├── serve-static@1.11.
├── depd@1.1.
├── qs@6.2.
├── on-finished@2.3. (ee-first@1.1.)
├── debug@2.2. (ms@0.7.)
├── finalhandler@0.5. (unpipe@1.0., statuses@1.3.)
├── proxy-addr@1.1. (forwarded@0.1., ipaddr.js@1.1.)
├── type-is@1.6. (media-typer@0.3., mime-types@2.1.)
├── accepts@1.3. (negotiator@0.6., mime-types@2.1.)
└── send@0.14. (destroy@1.0., ms@0.7., mime@1.3., statuses@1.3., http-errors@1.5.)
安装成功!
查看已安装包中包括express:
$ npm ls -g
/usr/lib
├─┬ express@4.14.
│ ├─┬ accepts@1.3.
│ │ ├─┬ mime-types@2.1.
│ │ │ └── mime-db@1.25.
│ │ └── negotiator@0.6.
│ ├── array-flatten@1.1.
│ ├── content-disposition@0.5.
│ ├── content-type@1.0.
│ ├── cookie@0.3.
│ ├── cookie-signature@1.0.
│ ├─┬ debug@2.2.
│ │ └── ms@0.7.
│ ├── depd@1.1.
│ ├── encodeurl@1.0.
│ ├── escape-html@1.0.
│ ├── etag@1.7.
│ ├─┬ finalhandler@0.5.
│ │ ├── statuses@1.3.
│ │ └── unpipe@1.0.
│ ├── fresh@0.3.
│ ├── merge-descriptors@1.0.
│ ├── methods@1.1.
│ ├─┬ on-finished@2.3.
│ │ └── ee-first@1.1.
│ ├── parseurl@1.3.
│ ├── path-to-regexp@0.1.
│ ├─┬ proxy-addr@1.1.
│ │ ├── forwarded@0.1.
│ │ └── ipaddr.js@1.1.
│ ├── qs@6.2.
│ ├── range-parser@1.2.
│ ├─┬ send@0.14.
│ │ ├── destroy@1.0.
│ │ ├─┬ http-errors@1.5.
│ │ │ ├── inherits@2.0.
│ │ │ └── setprototypeof@1.0.
│ │ ├── mime@1.3.
│ │ ├── ms@0.7.
│ │ └── statuses@1.3.
│ ├── serve-static@1.11.
│ ├─┬ type-is@1.6.
│ │ ├── media-typer@0.3.
│ │ └─┬ mime-types@2.1.
│ │ └── mime-db@1.25.
│ ├── utils-merge@1.0.
│ └── vary@1.1.
在Ubuntu全局安装express报错:Error: EACCES, mkdir '/usr/lib/node_modules/express'的解决办法的更多相关文章
- [原创] ubuntu下安装scrapy报错 error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Ubuntu14.04在virtualenv下安装scrapy报错,Failed building wheel for cffi,lxml,cryptography 等. error: command ...
- 安装Scrapy报错 error: Microsoft Visual C++ 14.0 is required解决方法
[问题背景]:在Windows 10系统,pip install Scrapy,报错error: Microsoft Visual C++ 14.0 is required,还有提示Twisted需要 ...
- CentOS7安装MySQL报错Failed to start mysqld.service: Unit not found解决办法
1 ~]# systemctl start mysql.service 要启动MySQL数据库是却是这样的提示 1 ~]# Failed to start mysqld.service: Unit n ...
- 抓取https网页时,报错sun.security.validator.ValidatorException: PKIX path building failed 解决办法
抓取https网页时,报错sun.security.validator.ValidatorException: PKIX path building failed 解决办法 原因是https证书问题, ...
- ubuntu pip 安装django报错解决
系统版本 ubuntu Kylin 16.04 LTS 安装pip3 安装 Django 总是提示time out,无法安装. 逛了好多论坛终于遭到了解决办法,分享保存: sudo pi ...
- python27(32位)安装模块报错“error: Unable to find vcvarsall.bat”
1)首先,下载一个Microsoft Visual C++ Compiler for Python 2.7的补丁,下载地址在这里: http://www.microsoft.com/en-us/dow ...
- 安装zabbix-agent报错 Error: failure: repodata/primary.xml.gz from zabbix: [Errno 256] No more mirrors to try.
安装zabbix-agent报错 yum install -y zabbix-agent Loaded plugins: fastestmirror, refresh-packagekit, secu ...
- 【问题】yum安装软件报错ERROR:dbus.proxies
转自:Yum安装报错:ERROR:dbus.proxies 环境: [红帽企业Linux.6.4.服务器版].rhel-server-6.4-x86_64-dvd(ED2000.COM).iso 安装 ...
- 安装nghttp2 报错error: Libtool library used but 'LIBTOOL' is undefined
nghttp2 报错error: Libtool library used but ‘LIBTOOL‘ is undefined 如果重新安装libtool和autoconf升级到2.69后,还是报错 ...
随机推荐
- Qlik 函数说明
集合表达式 包括 标识符 标识符 说明 1 表示应用程序中所有记录的完整集合,而不考虑选择的任何选择项.考虑维度 $ 表示当前选择项的记录.因此,集合表达式 {$} 与不陈述集合表达式的意义等同. $ ...
- unity3d InverseTransformPoint方法
从歪果仁的脚本里看到了这个方法,查脚本,看脚本说明也没看懂,官方的说明是,变换位置从世界坐标到自身坐标,Transform.TransformPoint相反. 试验了一下得出这个结论,如果某一个物体A ...
- linux 服务器登录显示lastlogin
1.参数修改: /etc/ssh/sshd_config 问价里边的 printlastlog 设置为yes /etc/ssh/sshd_config 问价里边的 printmotd 设置为yes 2 ...
- 开发常用小demo 整理
pc懒加载 https://github.com/ningmengxs/Lazy_loading 元素滑动 js 效果 https://github.com/ningmengxs/elem ...
- 第八十七天请假 PHP smarty模板配置以及简单的调用方式
smarty模板的配置文件 <?php define("ROOT",str_replace("\\","/",dirname(__FI ...
- struts标签,<s:textfield>嵌套<s:property>的问题
错误:org.apache.jasper.JasperException: /front/orderList.jsp(110,122) equal symbol expected <s:te ...
- smarty基本语法
smarty基本语法: 1.注释:<{* this is a comment *}>,注意左右分隔符的写法,要和自己定义的一致. <{* I am a Smarty comment, ...
- iOS 发送Email
第一步:在程序中添加MessageUi.framework框架 第二步:引入#import <MessageUI/MessageUI.h>头文件 第三步:代码实现 3.1判断是否可以发送邮 ...
- poj 2891 Strange Way to Express Integers (非互质的中国剩余定理)
Strange Way to Express Integers Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 9472 ...
- (学习网址)Python 自动化测试
1.Python自动化测试地址 http://www.wtoutiao.com/author/python-selenium.html 2.unittest参考网址: 1)python自动化测试报告H ...