$ 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'的解决办法的更多相关文章

  1. [原创] 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 ...

  2. 安装Scrapy报错 error: Microsoft Visual C++ 14.0 is required解决方法

    [问题背景]:在Windows 10系统,pip install Scrapy,报错error: Microsoft Visual C++ 14.0 is required,还有提示Twisted需要 ...

  3. CentOS7安装MySQL报错Failed to start mysqld.service: Unit not found解决办法

    1 ~]# systemctl start mysql.service 要启动MySQL数据库是却是这样的提示 1 ~]# Failed to start mysqld.service: Unit n ...

  4. 抓取https网页时,报错sun.security.validator.ValidatorException: PKIX path building failed 解决办法

    抓取https网页时,报错sun.security.validator.ValidatorException: PKIX path building failed 解决办法 原因是https证书问题, ...

  5. ubuntu pip 安装django报错解决

    系统版本 ubuntu  Kylin 16.04 LTS       安装pip3 安装 Django 总是提示time out,无法安装. 逛了好多论坛终于遭到了解决办法,分享保存: sudo pi ...

  6. python27(32位)安装模块报错“error: Unable to find vcvarsall.bat”

    1)首先,下载一个Microsoft Visual C++ Compiler for Python 2.7的补丁,下载地址在这里: http://www.microsoft.com/en-us/dow ...

  7. 安装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 ...

  8. 【问题】yum安装软件报错ERROR:dbus.proxies

    转自:Yum安装报错:ERROR:dbus.proxies 环境: [红帽企业Linux.6.4.服务器版].rhel-server-6.4-x86_64-dvd(ED2000.COM).iso 安装 ...

  9. 安装nghttp2 报错error: Libtool library used but 'LIBTOOL' is undefined

    nghttp2 报错error: Libtool library used but ‘LIBTOOL‘ is undefined 如果重新安装libtool和autoconf升级到2.69后,还是报错 ...

随机推荐

  1. angular学习笔记,很乱哈哈。

    1.鼠标悬浮出现的信息v-bind:title="message" 2.对该便签进行结果判断显示隐藏v-if=''控制台设置 app3.seen = false(消失).控制台设置 ...

  2. Fastcgi介绍和php中fastcgi的应用

    先看下FastCgi的一些解释: CGI全称是“通用网关接口”(Common Gateway Interface), 它可以让一个客户端,从网页浏览器向执行在Web服务器上的程序请求数据. CGI描述 ...

  3. 添加图片按钮-UI界面编辑器(SkinStudio)教程

    打开工具箱,选择Button控件 在窗体上添加一个Button控件 给Button控件的ImageNormal属性添加图片 添加完成后的效果 删除Text属性的值(即删除显示的文本)

  4. UVa 490 - Rotating Sentences

    https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=s ...

  5. Maven3路程(三)用Maven创建第一个web项目(1)

    一.创建项目 1.Eclipse中用Maven创建项目 上图中Next 2.继续Next 3.选maven-archetype-webapp后,next 4.填写相应的信息,Packaged是默认创建 ...

  6. JQuery 动画及一些小知识点

    JQuery  动画 show(),hide()显示/隐藏slideDown(),slideUp() 拉开/合起fadeIn(),fadeOut()渐出/渐入自定义动画 animate({left:& ...

  7. MYSQL服务器字符集设置

    修改默认字符集 vi /etc/my.cnf 在[mysqld]下面加入default-character-set=utf8 在[client]下面加入default-character-set=ut ...

  8. js jquery 扩展方法

    //扩展Array,增加IsInAyyay函数.函数功能:判断数组是否包含某元素 Array.prototype.IsInAyyay=function(e) { for (var i=0;i<t ...

  9. INNO SETUP 5.5.0以上版本中文语言包

    ; *** Inno Setup version 5.5.0+ Chinese messages ***;; To download user-contributed translations of ...

  10. PTA List Components

    For a given undirected graph with N vertices and E edges, please list all the connected components b ...