# Elm-pages is failing with ERR! code ELIFECYCLE

**URL:** <https://discourse.elm-lang.org/t/elm-pages-is-failing-with-err-code-elifecycle/10120>\
**Category:** Learn\
**Created:** [January 28, 2025, 7:37pm UTC](https://discourse.elm-lang.org/t/elm-pages-is-failing-with-err-code-elifecycle/10120 "2025-01-28T19:37:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralphtq](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@ralphtq](https://discourse.elm-lang.org/u/ralphtq)\
**Post date:** [January 28, 2025, 7:37pm UTC](https://discourse.elm-lang.org/t/elm-pages-is-failing-with-err-code-elifecycle/10120/1 "2025-01-28T19:37:58Z")

</div>

An elm-pages app that was working ok with ‘npm start’ is now failing with:

…/node\_modules/elm-pages/generator/src/cli.js:4  
import \* as build from “./build.js”;  
^^^^^^

SyntaxError: Cannot use import statement outside a module  
at Module.\_compile (internal/modules/cjs/loader.js:891:18)  
at Object.Module.\_extensions…js (internal/modules/cjs/loader.js:991:10)  
at Module.load (internal/modules/cjs/loader.js:811:32)  
at Function.Module.\_load (internal/modules/cjs/loader.js:723:14)  
at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)  
at internal/main/run\_main\_module.js:17:11  
npm ERR! code ELIFECYCLE  
npm ERR! errno 1  
npm ERR! elm-pages-app@ start: `elm-pages dev`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the elm-pages-app@ start script.  
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I wondering what has caused this.

My npm is 6.13.5, node is v12.14.1  
My elm is 0.19.1

Hoping this is simple to fix

Ralph

---

<div class="post-metadata">

**Author:** ![lydell](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/lydell/32/178_2.png) [@lydell](https://discourse.elm-lang.org/u/lydell)\
**Post date:** [January 28, 2025, 8:03pm UTC](https://discourse.elm-lang.org/t/elm-pages-is-failing-with-err-code-elifecycle/10120/2 "2025-01-28T20:03:47Z")

</div>

Node.js 12 is very old. It got end-of-life 3 years ago.

Try Node.js 20 or later.

---

<div class="post-metadata">

**Author:** ![ralphtq](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@ralphtq](https://discourse.elm-lang.org/u/ralphtq)\
**Post date:** [January 28, 2025, 8:15pm UTC](https://discourse.elm-lang.org/t/elm-pages-is-failing-with-err-code-elifecycle/10120/3 "2025-01-28T20:15:45Z")

</div>

Yes - that must be it. I have another Mac with node.js 20 and on that Mac my code works.

Updated node to v23.6.1 on the failing Mac - all works now.

Something must have installed an earlier version of node globally.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [February 7, 2025, 8:16pm UTC](https://discourse.elm-lang.org/t/elm-pages-is-failing-with-err-code-elifecycle/10120/4 "2025-02-07T20:16:40Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
