Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

terminal: "npm install -g react-native-cli"

Tags:

npm

macos

npm install -g react-native-cli

npm ERR! tar.unpack untar error /Users/qufenqi/.npm/react-native-     cli/0.1.4/package.tgz
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "react-native-cli"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
 npm ERR! path /usr/local/lib/node_modules/react-native-cli
npm ERR! code EACCES

npm ERR! errno -13

npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/react-native-cli'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/react-native-      cli']
 npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/react-native-cli',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/local/lib/node_modules/react-native-cli',
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:95:15)' ] }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with a

but when i install node,say " brew install node Warning: node-0.12.7 already installed, it's just not linked"

like image 335
user2305019 Avatar asked Aug 02 '26 01:08

user2305019


2 Answers

You don't have write access to the directory

/usr/local/lib/node_modules/react-native-cli

As you're going to install the library globally, you need admin permissions, so do that as root using sudo command:

sudo npm install -g react-native-cli
like image 169
Eduardo Yáñez Parareda Avatar answered Aug 05 '26 09:08

Eduardo Yáñez Parareda


if the error persists and showing you that the symlink is already exists

npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/react-native-cli/index.js' -> '/usr/local/bin/react-native'
npm ERR! File exists: /usr/local/bin/react-native

add --force

sudo npm install -g react-native-cli --force

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!