fengzhenhai@fengzhenhaideMacBook-Pro ~ % npm install -g cnpm --registry=https://registry.npmmirror.com
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/cnpm
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/cnpm'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/cnpm'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/cnpm'
npm ERR! }
在npm install 命令前添加sudo搞定。
去掉npm config set 前的sudo搞定。
安装create-react-app插件,在cnpm install前添加sudo
在指定目录创建my-app
进入my-app执行npm start