Npm install getting stuck in theme development

Hi guys I’m trying to customize the Headline theme in GHOST and when running npm install for the required packages, my installation hangs infinitely stuck at the output below:

npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer de
pendencies
npm WARN deprecated multer@1.4.4: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for ve
rsions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older ve
rsions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatib
ility with Node.js 0.10.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated stable@0.1.8: 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_com
patibility
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstanc
es, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
[       ...........] / diffTrees: sill install generateActionsToTake

My package.json is as below

{
    "name": "headline",
    "description": "A Ghost theme",
    "version": "1.0.0",
    "private": true,
    "engines": {
        "ghost": ">=5.0.0"
    },
    "license": "MIT",
    "author": {
        "name": "Ghost Foundation",
        "email": "hello@ghost.org",
        "url": "https://ghost.org"
    },
    "keywords": [
        "ghost",
        "theme",
        "ghost-theme"
    ],
    "config": {
        "posts_per_page": 7,
        "image_sizes": {
            "xs": {
                "width": 150
            },
            "s": {
                "width": 300
            },
            "m": {
                "width": 720
            },
            "l": {
                "width": 960
            },
            "xl": {
                "width": 1200
            },
            "xxl": {
                "width": 2000
            }
        },
        "card_assets": true,
        "custom": {
            "navigation_layout": {
                "type": "select",
                "options": ["Logo on the left", "Logo in the middle", "Stacked"],
                "default": "Stacked"
            },
            "header_style": {
                "type": "select",
                "options": ["Light", "Accent color", "Dark"],
                "default": "Light"
            },
            "title_font": {
                "type": "select",
                "options": ["Modern sans-serif", "Elegant serif"],
                "default": "Modern sans-serif"
            },
            "body_font": {
                "type": "select",
                "options": ["Modern sans-serif", "Elegant serif"],
                "default": "Elegant serif"
            },
            "white_publication_logo_for_transparent_header": {
                "type": "image"
            },
            "email_signup_text": {
                "type": "text",
                "default": "Don't miss out on the latest news. Sign up now to get access to the library of members-only articles."
            },
            "footer_text": {
                "type": "text"
            },
            "enter_tag_slugs_for_primary_sections": {
                "type": "text",
                "group": "homepage"
            },
            "enter_tag_slugs_for_secondary_sections": {
                "type": "text",
                "group": "homepage"
            }
        }
    },
    "scripts": {
        "dev": "gulp",
        "test": "gscan .",
        "zip": "gulp zip"
    },
    "devDependencies": {
        "@tryghost/shared-theme-assets": "1.3.1",
        "autoprefixer": "10.4.13",
        "beeper": "2.1.0",
        "cssnano": "5.1.14",
        "gscan": "4.34.0",
        "gulp": "4.0.2",
        "gulp-concat": "2.6.1",
        "gulp-livereload": "4.0.2",
        "gulp-postcss": "9.0.1",
        "gulp-uglify": "3.0.2",
        "gulp-zip": "5.1.0",
        "postcss": "8.4.19",
        "postcss-easy-import": "4.0.0",
        "pump": "3.0.0"
    }
}

I would like to customize this theme but it appears I can’t find any solutions to this, would anyone know how I can resolve this? Thank you in advance.

Is it actually erroring out, or just lots of warnings? I did an npm install last and spent several minutes waiting for it to chug through all the warnings, but it did, and gulp worked fine.

Hi cathy,
It did not error out, it hanged there for hours. I suspect it’s getting stuck in something infinitely.

It got stuck at:

[ …] / diffTrees: sill install generateActionsToTake

I was using node version v14 and a rather low npm version which turned out to be the problem.

Followed this guide: How to update Node.js and NPM to next version ? - GeeksforGeeks

After installing node v16 and npm v8, it works!

2 Likes