thuliteio/doks

Hugo Installer causing error

realchandan opened this issue · 2 comments

Description

I'm getting a command failed error for command C:\Windows\system32\cmd.exe /d /s /c hugo-installer --version otherDependencies.hugo --extended --destination node_modules/.bin/hugo. It says Invalid values:, Argument: arch, Given: "ia32", Choices: "arm", "arm64", "x64", "x86".

Steps to Reproduce

This happens on my Windows 10. I think it should happen on other people's Windows 10 as well. I have tried to run the npm create hyas@latest -- --template doks command on WSL, but it doesn't work either. I get this on WSL: CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory.

Expected Result

Dependencies should have installed without error.

Actual Result

I got an error.

Environment

> hyas-project@0.0.0 preinfo
> npm version

{
  'hyas-project': '0.0.0',
  npm: '10.4.0',
  node: '20.11.0',
  acorn: '8.11.2',
  ada: '2.7.4',
  ares: '1.20.1',
  base64: '0.5.1',
  brotli: '1.0.9',
  cjs_module_lexer: '1.2.2',
  cldr: '43.1',
  icu: '73.2',
  llhttp: '8.1.1',
  modules: '115',
  napi: '9',
  nghttp2: '1.58.0',
  nghttp3: '0.7.0',
  ngtcp2: '0.8.1',
  openssl: '3.0.12+quic',
  simdutf: '4.0.4',
  tz: '2023c',
  undici: '5.27.2',
  unicode: '15.0',
  uv: '1.46.0',
  uvwasi: '0.0.19',
  v8: '11.3.244.8-node.17',
  zlib: '1.2.13.1-motley-5daffc7'
}

> hyas-project@0.0.0 info
> npm list

npm ERR! code ELSPROBLEMS
npm ERR! missing: @hyas/doks-core@^1.4.1, required by hyas-project@0.0.0
npm ERR! missing: @hyas/images@^3.1.0, required by hyas-project@0.0.0
npm ERR! missing: @hyas/inline-svg@^1.0.5, required by hyas-project@0.0.0
npm ERR! missing: @hyas/seo@^2.1.0, required by hyas-project@0.0.0
npm ERR! missing: @tabler/icons@^2.40.0, required by hyas-project@0.0.0
npm ERR! missing: exec-bin@^1.0.0, required by hyas-project@0.0.0
npm ERR! missing: gethyas@^2.2.2, required by hyas-project@0.0.0
npm ERR! missing: hugo-installer@^4.0.1, required by hyas-project@0.0.0
npm ERR! missing: shx@^0.3.4, required by hyas-project@0.0.0
hyas-project@0.0.0 C:\Users\Chandan\Documents\hyas-project
├── UNMET DEPENDENCY @hyas/doks-core@^1.4.1
├── UNMET DEPENDENCY @hyas/images@^3.1.0
├── UNMET DEPENDENCY @hyas/inline-svg@^1.0.5
├── UNMET DEPENDENCY @hyas/seo@^2.1.0
├── UNMET DEPENDENCY @tabler/icons@^2.40.0
├── UNMET DEPENDENCY exec-bin@^1.0.0
├── UNMET DEPENDENCY gethyas@^2.2.2
├── UNMET DEPENDENCY hugo-installer@^4.0.1
└── UNMET DEPENDENCY shx@^0.3.4

I cannot reproduce your issue on Windows 11 Pro (Node v20.11.0 and npm 10.2.4) and with WSL (Node v20.11.1 and npm 10.2.4)

What you could try:

  • delete package-lock.json and the node_modules directory — then run npm i again
  • use npm 10.2.4

Has anyone else stumbled upon this issue?

If this doesn't help, maybe it's a good idea to raise an issue: dominique-mueller/hugo-installer

BTW) In the upcoming Hyas 2.3 release — available soon — hugo-installer will be dropped. Then you will need to use your own (global) Hugo install

The issue was happening due to the missing --arch argument, which led it to default to ia32.

I forked your gethyas/hyas and changed the postinstall script to include the --arch x64 argument.

And now I am referencing my forked GitHub repository in my site's package.json.

before

"gethyas": "^2.2.2",

after

"gethyas": "github:realchandan/hyas#002cd14d6a1311e0ca45693ee7e79d40e848094d",

Also, I had to add the --arch x64 argument to the postinstall script for my site's package.json.

And it worked fine.

Thank you for creating this theme.