私はreactネイティブを使用してプロジェクトを作成しようとしましたが、これを実行できませんでした。私はhttps://facebook.github.io/react-native/docs/getting-started.htmlReact Nativeを使用してプロジェクトを作成しようとしたときにエラーが発生しました
ノードと警備員からの命令を使用しています
が既にインストールされ、その後、私が入力したとき:
npm install -g react-native-cli
が、私はこれを取得:
/usr/local/bin/react-native -> /usr/local/lib/node_modules/react-native-cli/index.js
[email protected] /usr/local/lib/node_modules/react-native-cli
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
私がやろう:
react-native init AwesomeProject
私は以下を取得します:
This will walk you through creating a new React Native project in /Users/jaimito/AwesomeProject
Installing react-native package from npm...
npm WARN peerDependencies The peer dependency [email protected]~15.2.1 included from react-native will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.4.0/bin/node" "/usr/local/bin/npm" "install" "--save" "--save-exact" "react-native"
npm ERR! node v6.4.0
npm ERR! npm v2.15.9
npm ERR! path /Users/jaimito/.npm/optimist/0.6.1
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/Users/jaimito/.npm/optimist/0.6.1'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, mkdir '/Users/jaimito/.npm/optimist/0.6.1'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/Users/jaimito/.npm/optimist/0.6.1',
npm ERR! parent: 'react-native' }
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/jaimito/AwesomeProject/npm-debug.log
`npm install --save --save-exact react-native` failed
どうすればこれらのエラーを回避できますか?
私はMacを使用しています。
コマンドの最初にsudoを使用しました。しかし、私が行ったとき:私は最初にsudoを使用してみました
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/Users/jaimito/.babel.json'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at save (/Users/jaimito/AwesomeProject/node_modules/react-native/node_modules/babel-register/lib/cache.js:53:16)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:592:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
と私はこれだ:
cd AwesomeProject
react-native run-ios
私が得た
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/Users/jaimito/.babel.json'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at save (/Users/jaimito/AwesomeProject/node_modules/react-native/node_modules/babel-register/lib/cache.js:53:16)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:592:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
~
Process terminated. Press <enter> to close the window
試し
場合や、必要に応じて))(または
marked
内部0.3.*
ディレクトリ、それを取り戻すために試してみてください" – Fantasimまたはsudoでコマンドを実行しようとしました – Fantasim