ipfs-blog icon indicating copy to clipboard operation
ipfs-blog copied to clipboard

Building the blog on newer Node.js version fails

Open 2color opened this issue 1 year ago • 0 comments

What's the problem

With recent releases of Node.js, you get the following error:

➜  ipfs-blog git:(main) npm run start

> [email protected] start
> npm run dev


> [email protected] dev
> vuepress dev src

wait Extracting site metadata...
tip Apply local theme at /Users/danielnorman/dev/ipfs-blog/src/.vuepress/theme...
tip Apply theme local ...
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
tip Apply plugin clean-urls (i.e. "vuepress-plugin-clean-urls") ...
tip Apply plugin vuepress-plugin- ...
tip Apply plugin vuepress-default-canonical ...
tip Apply plugin vuepress-plugin-trigger-scroll ...
tip Apply plugin @vuepress/blog (i.e. "@vuepress/plugin-blog") ...
tip Apply plugin sitemap (i.e. "vuepress-plugin-sitemap") ...
tip Apply plugin @vuepress/last-updated (i.e. "@vuepress/plugin-last-updated") ...
tip Apply plugin feed (i.e. "vuepress-plugin-feed") ...
tip Apply plugin seo (i.e. "vuepress-plugin-seo") ...
tip Apply plugin vuepress-plugin-og-image ...
tip Apply plugin robots (i.e. "vuepress-plugin-robots") ...
tip Apply plugin @vuepress/html-redirect (i.e. "@vuepress/plugin-html-redirect") ...
tip Apply plugin chunkload-redirect (i.e. "vuepress-plugin-chunkload-redirect") ...
(node:38508) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
warning Override existing page /weekly-136/.
success vuepress-plugin-feed rss2 link added to siteConfig.head

● Client █████████████████████████ compiling (0%)


ℹ 「wds」: Project is running at http://0.0.0.0:8081/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /Users/danielnorman/dev/ipfs-blog/src/.vuepress/public
ℹ 「wds」: 404s will fallback to /index.html
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:79:19)
    at Object.createHash (node:crypto:139:10)
    at module.exports (/Users/danielnorman/dev/ipfs-blog/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/danielnorman/dev/ipfs-blog/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/danielnorman/dev/ipfs-blog/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/danielnorman/dev/ipfs-blog/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/danielnorman/dev/ipfs-blog/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/danielnorman/dev/ipfs-blog/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/danielnorman/dev/ipfs-blog/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/Users/danielnorman/dev/ipfs-blog/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/danielnorman/dev/ipfs-blog/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/Users/danielnorman/dev/ipfs-blog/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/Users/danielnorman/dev/ipfs-blog/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/Users/danielnorman/dev/ipfs-blog/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/danielnorman/dev/ipfs-blog/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/danielnorman/dev/ipfs-blog/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
node:internal/crypto/hash:79
  this[kHandle] = new _Hash(algorithm, xofLen, algorithmId, getHashCache());
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:79:19)
    at Object.createHash (node:crypto:139:10)
    at module.exports (/Users/danielnorman/dev/ipfs-blog/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/danielnorman/dev/ipfs-blog/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/danielnorman/dev/ipfs-blog/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/danielnorman/dev/ipfs-blog/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/danielnorman/dev/ipfs-blog/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/danielnorman/dev/ipfs-blog/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/danielnorman/dev/ipfs-blog/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/Users/danielnorman/dev/ipfs-blog/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/danielnorman/dev/ipfs-blog/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/danielnorman/dev/ipfs-blog/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /Users/danielnorman/dev/ipfs-blog/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3) {
  opensslErrorStack: [
    'error:03000086:digital envelope routines::initialization error',
    'error:0308010C:digital envelope routines::unsupported'
  ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v22.6.0

Temporary workaround

Setting the following environment variable helps:

NODE_OPTIONS=--openssl-legacy-provider npm run start

2color avatar Oct 30 '24 11:10 2color