javascript - npm run deploy 脚本没有给出链接
问题描述
当我尝试使用 npm run deploy 时,我不断收到此错误消息。
但是,我的 package.json 文件中似乎确实有一个部署脚本
我也加入了 package.json 目录
我尝试打开 github 页面,但是当我转到链接时,它给了我一个 404 错误
结果我关闭了github页面
扩展错误消息(npm 调试日志):
14 verbose lifecycle myportfoliosite@0.1.0~deploy: CWD: C:\Users\Ali Haider\AppData\Roaming\npm\node_modules\create-react-app\myportfoliosite\myportfoliosite
15 silly lifecycle myportfoliosite@0.1.0~deploy: Args: [ '/d /s /c', 'gh-pages -d build' ]
16 silly lifecycle myportfoliosite@0.1.0~deploy: Returned: code: 1 signal: null
17 info lifecycle myportfoliosite@0.1.0~deploy: Failed to exec deploy script
18 verbose stack Error: myportfoliosite@0.1.0 deploy: `gh-pages -d build`
18 verbose stack Exit status 1
18 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
18 verbose stack at EventEmitter.emit (events.js:198:13)
18 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
18 verbose stack at ChildProcess.emit (events.js:198:13)
18 verbose stack at maybeClose (internal/child_process.js:982:16)
18 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
19 verbose pkgid myportfoliosite@0.1.0
20 verbose cwd C:\Users\Ali Haider\AppData\Roaming\npm\node_modules\create-react-app\myportfoliosite\myportfoliosite
21 verbose Windows_NT 10.0.17134
22 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "deploy"
23 verbose node v10.16.0
24 verbose npm v6.9.0
25 error code ELIFECYCLE
26 error errno 1
27 error myportfoliosite@0.1.0 deploy: `gh-pages -d build`
27 error Exit status 1
28 error Failed at the myportfoliosite@0.1.0 deploy script.
28 error This is probably not a problem with npm. There is likely additional logging output above.
29 verbose exit [ 1, true ]
File sizes after gzip:
73.02 KB build\static\js\2.f6e5e996.chunk.js
19.04 KB build\static\css\2.b1979bb4.chunk.css
797 B build\static\js\runtime~main.4f085a03.js
152 B build\static\js\main.a0a932a3.chunk.js
The project was built assuming it is hosted at /InquisitiveDev2016/ReactDeveloperPortfolio/.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
Find out more about deployment here:
终端出现错误:
> myportfoliosite@0.1.0 deploy C:\Users\Ali Haider\AppData\Roaming\npm\node_modules\create-react-app\myportfoliosite\myportfoliosite
> gh-pages -d build
'gh-pages' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myportfoliosite@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myportfoliosite@0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ali Haider\AppData\Roaming\npm-cache\_logs\2019-06-29T02_08_30_836Z-debug.log
这是我的存储库:https ://github.com/InquisitiveDev2016/ReactDeveloperPortfolio
我的 json 文件夹:
{
"name": "myportfoliosite",
"version": "0.1.0",
"private": true,
"homepage": "https://github.com/InquisitiveDev2016/ReactDeveloperPortfolio",
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-mdl": "^1.11.0",
"react-router-dom": "^5.0.1",
"react-scripts": "3.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
解决方案
推荐阅读
- gcc - g77 : ld: version-min 和目标文件上的警告
- javascript - axios获取请求未收到数据
- javascript - Service Worker - 图像缓存
- javascript - 为什么我的模态窗口在所有视图中都被复制
- model-view-controller - 如何在 UI5 中访问父视图的模型
- react-hooks - oidc-client + React Hooks 无限循环
- css - 打印时防止网格内部断裂
- java - NGINX:上游超时(110:连接超时),同时 SSL 与上游握手
- javascript - 为什么Vue的errorHandler无法捕捉到axios的错误?
- twilio - 如何从 Twilio Serverless 中的函数调用函数?