You can however run a command with sudo using –allow-root option
Error: post install error, please remove node_modules before retry!
Run “sh -c bower install && gulp –production” error, exit code 1
at ChildProcess.proc.on.code (/usr/local/lib/node_modules/cnpm/node_modules/runscript/index.js:67:21)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npminstall version: 2.16.1
npminstall args: /usr/local/Cellar/node/5.5.0/bin/node /usr/local/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js –china –userconfig=/Users/yt/.cnpmrc –disturl=https://npm.taobao.org/mirrors/node –registry=https://registry.npm.taobao.org