简体   繁体   English

安装React-Native时出现npm错误“标头内容包含无效字符”?

[英]npm error “ The header content contains invalid characters” when installing React-Native?

$ sudo npm install –g react-native-cli
npm ERR! addLocal Could not install /usr/local/bin/–g
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "–g"       "react-native-cli"
npm ERR! node v6.2.2
npm ERR! npm  v2.14.7

npm ERR! The header content contains invalid characters
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/bin/npm-debug.log

I am following the guide from https://facebook.github.io/react-native/docs/getting-started.html 我正在遵循https://facebook.github.io/react-native/docs/getting-started.html中的指南

Hitting a wall with that error. 碰到那个错误的墙。 I have XCode installed and can't find a solution to this next step. 我已经安装了XCode,找不到下一步的解决方案。

Ended up using Homebrew to uninstall node and reinstall the latest version. 最终使用Homebrew卸载节点并重新安装了最新版本。 I made sure the latest version of npm was also installed. 我确保也安装了最新版本的npm。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM