// 命令
npm install -g create-react-app
// 报错内容
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "create-react-app ": Tags may not have any characters that encodeURIComponent encodes.
解决方式:
安装旧版对等依赖项
npm install --legacy-peer-deps
// 命令
npm install --legacy-peer-deps
// 执行效果
npm WARN saveError ENOENT: no such file or directory, open '/Users/mac/Documents/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/mac/Documents/package.json'
npm WARN Documents No description
npm WARN Documents No repository field.
npm WARN Documents No README data
npm WARN Documents No license field.
up to date in 0.203s
然后就再次执行 npm install -g create-react-app 命令,就可以正常运行啦