javascript - npm install express-generator -g报下面的错误,请各位帮忙看下
大家讲道理
大家讲道理 2017-04-11 11:19:08
0
5
753

npm ERR! tar.unpack untar error /Users/mac/.npm/express-generator/4.13.1/package.tgz
npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "express-generator" "-g"
npm ERR! node v4.4.4
npm ERR! npm v2.15.1
npm ERR! path /usr/local/lib/node_modules/express-generator
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/express-generator'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/express-generator']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/express-generator',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/express-generator',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:82:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/mac/Desktop/myapp/npm-debug.log

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(5)
Peter_Zhu

你真心没有前面加sudo啊,像这样:

sudo npm install express-generator -g

错误关键字:EACCES, permission denied

Ty80

https://docs.npmjs.com/getting-started/fixing-npm-permissions
nam的官方文档有解决方法

Peter_Zhu

没有权限

试下 sudo?

小葫芦

为什么要 sudo才能安装

大家讲道理

修改下目录权限就好 建议使用brew 或者nvm当时安装

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!