gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
73.92k stars 7.41k forks source link

Hugo is exiting with 255 when run from npm script #3629

Closed LaurieSReynolds closed 7 years ago

LaurieSReynolds commented 7 years ago

Running hugo from npm results in an exit status of 255. When I run hugo from the command line, it runs fine. The last version of hugo worked fine from the npm script.

npm script from package.json

"docs-hugo": "echo 'hugo....' && hugo -v -s docs",

Output

npm run docs-hugo
f
> configuration-service@0.0.1 docs-hugo /Users/lauriereynolds/dev/foo/configuration-service/docs/configuration-service
> echo 'hugo....' && hugo -v -s docs

hugo....
INFO 2017/06/22 10:29:46 Using config file:
INFO 2017/06/22 10:29:46 /Users/lauriereynolds/dev/foo/configuration-service/docs/configuration-service/docs/static/ is the only static directory available to sync from
INFO 2017/06/22 10:29:46 syncing static files to /Users/lauriereynolds/dev/foo/configuration-service/docs/configuration-service/docs/public/
WARN 2017/06/22 10:29:46 No translation bundle found for default language "en"
WARN 2017/06/22 10:29:46 Translation func for language en not found, use default.
WARN 2017/06/22 10:29:46 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
Started building sites ...
INFO 2017/06/22 10:29:46 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
ERROR 2017/06/22 10:29:46 Page's Now is deprecated and will be removed in Hugo 0.25. Use now (the template func).
WARN 2017/06/22 10:29:46 [en] Unable to locate layout for "taxonomyTerm": [taxonomy/category.terms.html.html taxonomy/category.terms.html _default/terms.html.html _default/terms.html indexes/indexes.html.html indexes/indexes.html theme/taxonomy/category.terms.html.html theme/taxonomy/category.terms.html theme/_default/terms.html.html theme/_default/terms.html theme/indexes/indexes.html.html theme/indexes/indexes.html]
WARN 2017/06/22 10:29:46 [en] Unable to locate layout for "section": [section/developing.html.html section/developing.html developing/list.html.html developing/list.html _default/section.html.html _default/section.html _default/list.html.html _default/list.html indexes/developing.html.html indexes/developing.html _default/indexes.html.html _default/indexes.html theme/section/developing.html.html theme/section/developing.html theme/developing/list.html.html theme/developing/list.html theme/_default/section.html.html theme/_default/section.html theme/_default/list.html.html theme/_default/list.html theme/indexes/developing.html.html theme/indexes/developing.html theme/_default/indexes.html.html theme/_default/indexes.html]
WARN 2017/06/22 10:29:46 [en] Unable to locate layout for "taxonomyTerm": [taxonomy/tag.terms.html.html taxonomy/tag.terms.html _default/terms.html.html _default/terms.html indexes/indexes.html.html indexes/indexes.html theme/taxonomy/tag.terms.html.html theme/taxonomy/tag.terms.html theme/_default/terms.html.html theme/_default/terms.html theme/indexes/indexes.html.html theme/indexes/indexes.html]
Built site for language en:
0 draft content
0 future content
0 expired content
11 regular pages created
8 other pages created
0 non-page files copied
0 paginator pages created
0 tags created
0 categories created
total in 11 ms

npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "docs-hugo"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! configuration-service@0.0.1 docs-hugo: `echo 'hugo....' && hugo -v -s docs`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the configuration-service@0.0.1 docs-hugo script 'echo 'hugo....' && hugo -v -s docs'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the configuration-service package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     echo 'hugo....' && hugo -v -s docs
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs configuration-service
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls configuration-service
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/lauriereynolds/dev/foo/configuration-service/docs/configuration-service/npm-debug.log

From the npm-debug.log


0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'docs-hugo' ]
2 info using npm@3.10.10
3 info using node@v6.11.0
4 verbose run-script [ 'predocs-hugo', 'docs-hugo', 'postdocs-hugo' ]
5 info lifecycle configuration-service@0.0.1~predocs-hugo: configuration-service@0.0.1
6 silly lifecycle configuration-service@0.0.1~predocs-hugo: no script for predocs-hugo, continuing
7 info lifecycle configuration-service@0.0.1~docs-hugo: configuration-service@0.0.1
8 verbose lifecycle configuration-service@0.0.1~docs-hugo: unsafe-perm in lifecycle true
9 verbose lifecycle configuration-service@0.0.1~docs-hugo: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/lauriereynolds/dev/foo/configuration-service/docs/configuration-service/node_modules/.bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/local/sbin
10 verbose lifecycle configuration-service@0.0.1~docs-hugo: CWD: /Users/lauriereynolds/dev/foo/configuration-service/docs/configuration-service
11 silly lifecycle configuration-service@0.0.1~docs-hugo: Args: [ '-c', 'echo \'hugo....\' && hugo -v -s docs' ]
12 silly lifecycle configuration-service@0.0.1~docs-hugo: Returned: code: 255  signal: null
13 info lifecycle configuration-service@0.0.1~docs-hugo: Failed to exec docs-hugo script
14 verbose stack Error: configuration-service@0.0.1 docs-hugo: `echo 'hugo....' && hugo -v -s docs`
14 verbose stack Exit status 255
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:891:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid configuration-service@0.0.1
16 verbose cwd /Users/lauriereynolds/dev/foo/configuration-service/docs/configuration-service
17 error Darwin 16.6.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "docs-hugo"
19 error node v6.11.0
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error configuration-service@0.0.1 docs-hugo: `echo 'hugo....' && hugo -v -s docs`
22 error Exit status 255
23 error Failed at the configuration-service@0.0.1 docs-hugo script 'echo 'hugo....' && hugo -v -s docs'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the configuration-service package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     echo 'hugo....' && hugo -v -s docs
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs configuration-service
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls configuration-service
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]```
anthonyfok commented 7 years ago

Hi @LaurieSReynolds,

Thank you for the report. Reviewing the log that you provided, there is an actual error in your website or the theme that you're using, resulting in an exit with error 255:

ERROR 2017/06/22 10:29:46 Page's Now is deprecated and will be removed in Hugo 0.25. Use now (the template func).

This was a WARNING in previous versions of Hugo, but became an ERROR since Hugo v0.21. The fix is simple though: just replace .Now with now.

See https://github.com/parsiya/Hugo-Octopress/issues/30 for an example, and https://gohugo.io/templates/functions/#now for the new now template function that replaces a page's .Now.

If you are using a third-party theme, upgrading to the latest version may do the trick. If not, please file an issue for the third-party theme that you're using.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.