reactjs - 运行“npm run build”时,它不会创建构建目录
问题描述
我对使用 React 还是有点陌生。我正在尝试使我的 git 存储库对 GitHub 页面可见。
运行时npm run build
,它成功编译,但不会创建构建文件夹。
结果,当我尝试运行npm run deploy
它时,它会一直运行,直到收到此错误:ENOENT: no such file or directory, stat '/Users/alejandro/Documents/FSMX/FSMX/build'
这是我的package.json
代码
"version": "1.0.0",
"description": "FSM X Project",
"main": "index.js",
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"start": "parcel index.html",
"build": "parcel build index.html"
这是我的index.html
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="./src/images/test.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="FSMX Experience"
/>
<title>FSMX Project</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="./src/index.js"></script>
</body>
</html>
有什么建议么?
解决方案
推荐阅读
- airflow - 气流:从以前的 dag 运行中获取 xcom
- android - 反应:a.href 在我的 index.jsx 文件中不起作用
- angular - 使用带有 ng2-pdfjs-viewer (viewerFolder) 的最新 pdf.js 发行版出现问题
- python - 如何在 Python 中进行 Gamma 分布?
- python-3.x - sudo:python3:找不到命令
- python - 如何在龙卷风python应用程序上添加速率限制
- javascript - Web 应用程序(Vue js,Laravel 8):在 Safari iOS 中滚动的最小视图
- asp.net-core - 未处理的异常。System.InvalidOperationException:JsonConvert.Deserialize() 的 LINQ 表达式错误
- python - 我如何解决 Pandas groupby 函数?
- twilio - 在选定设备中使用手机后置摄像头的 Twilio 可编程视频?