typescript - How to fix GitHub building "unknown token" error in yarn.lock for GitHub Pages? - Stack Overflow
I tried deploying a web-project for GitHub pages, unfortunately I am failing in the building process.
The error is stating there is an unknown token in line 1541 in yarn.lock . The attached snipped shows there isn't. Please advise how to proceed and successfully deploy the project.
Error during GitHub Actions building:
Run yarn
yarn
shell: /usr/bin/bash -e {0}
yarn install v1.22.22
error SyntaxError: Unknown token: { line: 1541, col: 40, type: 'COLON', value: undefined } 1541:40 in /home/runner/work/sa-skins/sa-skins/yarn.lock
at Parser.unexpected (/usr/local/lib/node_modules/yarn/lib/cli.js:64026:11)
at Parser.parse (/usr/local/lib/node_modules/yarn/lib/cli.js:64157:14)
at Parser.parse (/usr/local/lib/node_modules/yarn/lib/cli.js:64131:26)
at parse (/usr/local/lib/node_modules/yarn/lib/cli.js:64231:21)
at module.exports.exports.default (/usr/local/lib/node_modules/yarn/lib/cli.js:63793:96)
at Function.<anonymous> (/usr/local/lib/node_modules/yarn/lib/cli.js:3068:63)
at Generator.next (<anonymous>)
at step (/usr/local/lib/node_modules/yarn/lib/cli.js:310:30)
at /usr/local/lib/node_modules/yarn/lib/cli.js:321:13
info Visit for documentation about this command.
Error: Process completed with exit code 1.
Yarn.lock:
1540: [email protected]:
1541: version "1.8.1"
1542: resolved " 1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
1543: integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": ".",
"downlevelIteration": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
package.json
{
"name": "sa-skins",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"export": "next build && next export",
"deploy": "gh-pages -d out"
},
"dependencies": {
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@mui/icons-material": "^5.2.5",
"@mui/material": "^5.2.6",
"next": "12.0.7",
"react": "17.0.2",
"react-dom": "17.0.2",
"three": "^0.136.0"
},
"devDependencies": {
"@types/node": "17.0.5",
"@types/react": "17.0.38",
"@types/three": "^0.135.0",
"eslint": "8.6.0",
"eslint-config-next": "12.0.7",
"eslint-plugin-prettier": "^4.0.0",
"gh-pages": "^3.2.3",
"prettier": "^2.5.1",
"typescript": "4.5.4"
}
}
.github/workflows/ci.yml
name: CI/CD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'yarn'
- run: yarn
- run: yarn export
- if: ${{ github.event_name == 'push' }}
name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github/${GITHUB_REPOSITORY}.git
yarn deploy -u "github-actions-bot <[email protected]>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Full code:
最新文章
- 微软每年从安卓厂商获20亿美元专利费
- 微信支付和支付宝口水战开打!
- 消息称PC供应商面临来自Windows 8的挑战
- Google的AR眼镜
- react native - Handling loginlogout without user undefined errors - Stack Overflow
- docker compose - Issues with Using CapSolver Extension in Selenium Grid for reCaptcha v2 - Stack Overflow
- python - DeltaTable map type - Stack Overflow
- excel - Challange with DSUM Function: How can I use the DSUM function to sum values based on criteria that match the starting ch
- solrj - How to enable using a magic field with eDisMax in Solr 9.4? - Stack Overflow
- javascript - typeorm trying to delete relation table data when there is no change - Stack Overflow
- python - Bullets shooting from wrong position after player moved in small "Space Invaders" game - Stack Overfl
- Keeping Data In Denormalized NoSql Databases (CassandraScyllaDb) Tables In Sync? - Stack Overflow
- node.js - Push notification not getting delivered - Stack Overflow
- c++ - Casting std::optional inferior type - Stack Overflow
- r - Conflict between multiple uses of inset_element and function plot_annotation - Stack Overflow
- Disabling a JavaScript function when the device is offline - Stack Overflow
- command prompt - byobu - how to disable byobu_prompt_runtime - Stack Overflow