gyp WARN EACCES user root does not have permission to access the dev dir

1
2
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/countly/nodejs/lib/node_modules/time/.node-gyp/0.10.36"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/countly/nodejs/lib/node_modules/time/.node-gyp"

百度了好久资料,终于发现了解决办法,特此记录

1
sudo  npm install time   -g --unsafe-perm

增加了–unsafe-perm
顺便写一下新颁布 express 的安装

1
2
npm  -g install express
npm -g install express-generator