nikku / hugo-cli Goto Github PK
View Code? Open in Web Editor NEWRun hugo (the static site generator) painlessly from Node
Run hugo (the static site generator) painlessly from Node
I am unable to specify the required hugo version to be installed. Kindly let me know where this can be done. Tried mentioning the process.env.HUGO_VERSION=extended_0.53.0
in process.env file.
I am using yarn for js package dependency.
Hi, thanks for creating this cli. I have a suggestion to add example to README file on how to download specific hugo version.
$ HUGO_VERSION=0.64.0 npx hugo version
Describe the Bug
hugo-cli
doesn't work when being invoked on an M1 Macbook pro
Steps to Reproduce
test@test-mac sensu-docs % yarn
yarn install v1.22.19
info No lockfile found.
[1/5] π Validating package.json...
[2/5] π Resolving packages...
warning cssnano > cssnano-preset-default > postcss-svgo > [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
warning cssnano > cssnano-preset-default > postcss-svgo > svgo > [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
warning node-sass > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning node-sass > request > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning node-sass > request > [email protected]: this library is no longer supported
[3/5] π Fetching packages...
[4/5] π Linking dependencies...
[5/5] π¨ Building fresh packages...
success Saved lockfile.
$ grunt
Running "env:dev" (env) task
Running "env:dev" (env) task
Running "print-hugo-version" task
INFO hugo not found. Attempting to fetch it...
ERROR failed to download hugo: HTTPError: Response code 404 (Not Found)
failed to grab hugo :-(
GotError [HTTPError]: Response code 404 (Not Found)
at EventEmitter.<anonymous> (/Users/test/sensu-docs/node_modules/got/source/as-stream.js:35:24)
at EventEmitter.emit (node:events:513:28)
at module.exports (/Users/test/sensu-docs/node_modules/got/source/get-response.js:22:10)
at ClientRequest.handleResponse (/Users/test/sensu-docs/node_modules/got/source/request-as-event-emitter.js:155:5)
at Object.onceWrapper (node:events:628:26)
at ClientRequest.emit (node:events:525:35)
at origin.emit (/Users/test/sensu-docs/node_modules/@szmarczak/http-timer/source/index.js:37:11)
at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:693:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)
at TLSSocket.socketOnData (node:_http_client:534:22) {
host: 'github.com',
hostname: 'github.com',
method: 'GET',
path: '/gohugoio/hugo/releases/download/v0.101.0/hugo_0.101.0_macOS_ARM.tar.gz',
socketPath: undefined,
protocol: 'https:',
url: 'https://github.com/gohugoio/hugo/releases/download/v0.101.0/hugo_0.101.0_macOS_ARM.tar.gz',
gotOptions: {
path: '/gohugoio/hugo/releases/download/v0.101.0/hugo_0.101.0_macOS_ARM.tar.gz',
protocol: 'https:',
slashes: true,
auth: null,
host: 'github.com',
port: null,
hostname: 'github.com',
hash: null,
search: null,
query: null,
pathname: '/gohugoio/hugo/releases/download/v0.101.0/hugo_0.101.0_macOS_ARM.tar.gz',
href: 'https://github.com/gohugoio/hugo/releases/download/v0.101.0/hugo_0.101.0_macOS_ARM.tar.gz',
retry: {
retries: [Function (anonymous)],
methods: [Set],
statusCodes: [Set],
errorCodes: [Set]
},
headers: {
'user-agent': 'got/9.6.0 (https://github.com/sindresorhus/got)',
'accept-encoding': 'gzip, deflate'
},
hooks: {
beforeRequest: [],
beforeRedirect: [],
beforeRetry: [],
afterResponse: [],
beforeError: [],
init: []
},
decompress: true,
throwHttpErrors: true,
followRedirect: true,
stream: true,
form: false,
json: false,
cache: false,
useElectronNet: false,
method: 'GET'
},
statusCode: 404,
statusMessage: 'Not Found',
headers: {
server: 'GitHub.com',
date: 'Mon, 17 Oct 2022 14:08:22 GMT',
'content-type': 'text/plain; charset=utf-8',
vary: 'X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, X-Requested-With',
'cache-control': 'no-cache',
'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
'x-frame-options': 'deny',
'x-content-type-options': 'nosniff',
'x-xss-protection': '0',
'referrer-policy': 'no-referrer-when-downgrade',
'expect-ct': 'max-age=2592000, report-uri="https://api.github.com/_private/browser/errors"',
'content-security-policy': "default-src 'none'; base-uri 'self'; connect-src 'self'; form-action 'self'; img-src 'self' data:; script-src 'self'; style-src 'unsafe-inline'",
'content-encoding': 'gzip',
'content-length': '29',
'x-github-request-id': 'CA67:6C99:E82772:15F08B2:634D61D6',
connection: 'close'
},
body: undefined
}
Fatal error: Error
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
% uname -a
Darwin mac 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64
Expected Behavior
arch_exec
and arch_dl
should be able to ascertain the difference between ARM
and ARM64
Environment
already tried to install on another directory, restart the computer but still met an error, here the environment and step i took
$ node -v
v6.11.2
$ npm -v
3.10.10
$ cd ~/hugo
$ npm install hugo-cli
$ node_modules/.bin/hugo -h
hugo not downloaded yet. attempting to grab it...
fetched hugo v0.30.2
extracting archive...
we got it, let's go!
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn /Users/sugizo/hugo/node_modules/hugo-cli/tmp/hugo_0.30.2_darwin_amd64 ENOENT
at exports._errnoException (util.js:1020:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
How can I request a newer version of hugo?
Error: spawn C:\Users\AndrΓ© Zensen\Desktop\bpmn-js-doc\docs.bpmn.io\no
de_modules\hugo-cli\tmp\hugo_0.14_windows_amd64\hugo_0.14_windows_amd64.exe.exe
ENOENT
at exports._errnoException (util.js:870:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
When extracting the Windows binary, it is not stored within a folder like the Mac version.
For example on Mac:
tmp/hugo_0.18.1_macOS-64bit.zip
// extracts to...
tmp/hugo_0.18.1_darwin_amd64/hugo_0.18.1_darwin_amd64
On Windows:
tmp/hugo_0.18.1_Windows-64bit.zip
\\ extracts to...
tmp/hugo_0.18.1_windows_amd64.exe
PR to follow...
When trying to use a specific version of hugo, the download fails (404 - downloads the html) on version 0.17 and above.
This is because hugo-cli looks for hugo_${version}_${platform}_${arch}
e.g. hugo_0.17_darwin_amd64.zip
but the actual filename is hugo_0.17_MacOS-64bit.zip
Hello, I'm trying to setup hugo-cli to use a specific version (the latest extended version) via a grunt-exec script but any time I do that I get an error:
>> 'HUGO_VERSION' is not recognized as an internal or external command,
>> operable program or batch file.
>> Exited with code: 1.
>> Error executing child process: Error: Command failed: HUGO_VERSION=extended_0.64.0 npx hugo-cli
>> 'HUGO_VERSION' is not recognized as an internal or external command,
>> operable program or batch file.
I think I have found that if I run it like this in a standard command prompt (via the below commands) it works, but I am unable to get this to work via grunt no matter the combinations I try.
> set HUGO_VERSION=extended_0.64.0
> npx hugo-cli
This is a windows machine.
Thanks!
I have a clean install of windows and after installing hugo-cli globally, I get this error:
Error: unknown command "C:\Program Files\nodejs\node.exe" for "hugo"
Run 'hugo --help' for usage.
Hey,
since hugo 0.54.0 they changed the download link in github. So it is not possible to use hugo-cli for this version. Is it possible to use the current version with a flag or setting or do we need an updated version of the cli?
0.54.0: github.com/gohugoio/hugo/releases/download/v0.54.0/hugo_extended_0.54.0_macOS-64bit.tar.gz
0.53.0: github.com/gohugoio/hugo/releases/download/v0.53/hugo_extended_0.53_macOS-64bit.tar.gz
I'm using hugo 0.75.1 version on ubuntu 20
Using that to run:
HUGO_VERSION=0.75.1 node_modules/.bin/hugo serve --environment development
I change a scss file and it don't generate the resources file, but if I run the hugo build that is installed on my system it generates
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.