如何通过terminal安装create-react-app

我正在通过terminal安装create-react-app。 我已经检查了node.js的版本是4.5.0,比这里要求的要高。 而npm的版本是2.15.9。 然后我input命令npm install -g create-react-app ,出现这样的错误信息:

 npm ERR! tar.unpack untar error /Users/xiufenxu/.npm/create-react-app/0.6.0/package.tgz npm ERR! Darwin 16.0.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "create-react-app" npm ERR! node v4.5.0 npm ERR! npm v2.15.9 npm ERR! path /usr/local/lib/node_modules/create-react-app npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall mkdir npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/create-react-app' npm ERR! at Error (native) npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/create-react-app'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'mkdir', npm ERR! path: '/usr/local/lib/node_modules/create-react-app', npm ERR! fstream_type: 'Directory', npm ERR! fstream_path: '/usr/local/lib/node_modules/create-react-app', 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/xiufenxu/Documents/UM courses/Fall 2016/CSCI 5117/npm-debug.log 

我想知道为什么我有这样的错误。 有没有人能帮我弄清楚这个问题? 非常感谢!

Solutions Collecting From Web of "如何通过terminal安装create-react-app"