Upgrade to Hyas v2
This guide will walk you through the steps to manually migrate from Hyas v1 to Hyas v2.
Upgrading
You can upgrade your project by following the steps below.
1. Clean dependencies
Clean dependencies currently installed to avoid conflicts.
npm run clean:install
pnpm run clean:install
yarn run clean:install
2. Update package.json
Replace the contents of your project’s package.json
with the following:
{ "name": "hyas", "version": "0.0.0", "author": "Hyas", "license": "MIT", "scripts": { "dev": "exec-bin node_modules/.bin/hugo/hugo server --bind=0.0.0.0 --disableFastRender --baseURL=http://localhost --noHTTPCache", "dev:drafts": "exec-bin node_modules/.bin/hugo/hugo server --bind=0.0.0.0 --disableFastRender --baseURL=http://localhost --noHTTPCache --buildDrafts", "create": "exec-bin node_modules/.bin/hugo/hugo new", "lint": "npm run lint:scripts && npm run lint:styles && npm run lint:markdown", "lint:scripts": "eslint --cache config", "lint:styles": "stylelint --cache \"assets/scss/**/*.{css,sass,scss}\"", "lint:markdown": "markdownlint-cli2 \"*.md\" \"content/**/*.md\"", "test": "echo \"Error: no test specified\" && exit 1", "build": "exec-bin node_modules/.bin/hugo/hugo --minify", "preview": "http-server --gzip --brotli --ext=html --cors", "clean": "npm run clean:build && npm run clean:lint && npm run clean:install", "clean:build": "shx rm -rf public resources .hugo_build.lock", "clean:install": "shx rm -rf node_modules package-lock.json yarn.lock pnpm-lock.yaml", "clean:lint": "shx rm -rf .eslintcache .stylelintcache", "preinfo": "npm version", "info": "npm list", "postinfo": "exec-bin node_modules/.bin/hugo/hugo version", "postinstall": "shx rm -rf node_modules/.bin/hugo && shx mkdir node_modules/.bin/hugo && shx cp node_modules/gethyas/node_modules/.bin/hugo/* node_modules/.bin/hugo" }, "engines": { "node": ">=16.12.0" }}
3. Install Hyas and integrations
First, add an .npmrc
file to your project root with the following:
enable-pre-post-scripts = trueauto-install-peers = truenode-linker = hoistedprefer-symlinked-executables = false
Install Hyas
Next, install the latest version of Hyas:
npm install gethyas@latest
pnpm install gethyas@latest
yarn add gethyas@latest
Install integrations
Optionally, install the the recommended integrations in your project:
npm install @hyas/bootstrap@latest @hyas/images@latest @hyas/seo@latest
pnpm install @hyas/bootstrap@latest @hyas/images@latest @hyas/seo@latest
yarn add @hyas/bootstrap@latest @hyas/images@latest @hyas/seo@latest
Configuration
Update your configuration files for the recommended integrations:
Know Issues
ENOENT
When you get an ENOENT
error message, run the following command:
npm run clean:install && npm install
pnpm run clean:install && pnpm install
yarn run clean:install && yarn install