文章详情
【react】react项目运行npm run eject报错解决办法
发布时间:2022-01-09
沉默小管-技术博客
react项目运行npm run eject报错解决办法
1182
2
原文地址:
https://www.php-china.com//detail/88
H1
H2
H3
H4
H5
H6
# 报错原因 脚手架添加.gitgnore文件,但是却没有本地仓库。 # 解决流程 常用办法: ```bash cd project //进入项目根目录 git init // 当前目录新建代码库 git add . // 添加当前目录所有文件到暂存区 git commit -m 'Saving before ejecting' // 提交暂存区到仓库区 npm run eject //项目根目录运行 ``` **如果运行npm run eject报错**,查看项目根目录package.json文件,添加**eject: react-scripts eject** ```bash "scripts": { "start": "node scripts/start.js", "build": "node scripts/build.js", "test": "node scripts/test.js", "eject": "react-scripts eject" }, ``` **如果找不到react-scripts**,可以安装react-scripts ```bash npm install react-scripts --force ``` **最后再项目根目录运行npm run eject**,react项目就会出现隐藏的config配置文件.
上一篇
下一篇
收藏
支持
标签:
最新文章
统计信息
联系站长
加入技术群
日志总数:92篇
网站运行:1424天
累计访客:13007
热门文章
1. PHP基础概念
2. redis:ERR AUTH <password> called without any password configured for the default user解决办法
3. PHP的语言结构之包含文件
4. PHP中public,private,protected的区别
5. PHP魔术方法总结
6. php如何转换json格式中的中文
7. PHP7新特性(常用)
8. PHP7上项目报错A non-numeric value encountered解决办法
9. 运行golang出现invalid memory address or nil pointer dereference错误
10. git常用命令集合