在安装完Node.JS之后,安装 express 出现错误
错误如下:
D:\nodeJs>npm install express
npm ERR! Windows_NT 10.0.17134
npm ERR! argv "D:\\nodeJs\\node.exe" "D:\\nodeJs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express"
npm ERR! node v4.4.3
npm ERR! npm v2.15.1
npm ERR! path C:\Program Files\nodejs\node_cache
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall mkdir
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\Program Files\\nodejs\\node_cache' }
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! D:\nodeJs\npm-debug.log
权限问题
将命令行用管理员运行的方式打开再运行即可
出错仔细看一下原因,别急着立刻就去查。很多时候原因已经写清楚了,又不是完全看不懂英语