[英]Trying to put React Project on github pages but I get error: npm ERR! Missing script: "deploy"
尝试将 React Project 放在 Github 页上,但出现错误:
npm ERR! Missing script: "deploy"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in:
我按照以下步骤尝试将反应项目放在 github 页上:
Step 1
▶️ git remote add origin [YOUR REPO LINK]
▶️ git add -A
▶️ git commit -m "Initial commit"
▶️ git push -u origin main
Step 2
"homepage": "https://[USERNAME].github.io/[YOUR REPO NAME]",
Step 3
▶️ npm install gh-pages --save-dev
Step 4
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
▶️ npm run deploy
但是当把 npm 运行部署在终端我得到错误有人知道如何解决它吗? 我不明白为什么当我把它放在 m 脚本中并保存文件时它说脚本丢失:
"scripts": {
"start": "react-scripts start",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.