Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with npm - Named export 'postprocess' not found #9

Open
capital-G opened this issue Mar 15, 2023 · 1 comment
Open

Build fails with npm - Named export 'postprocess' not found #9

capital-G opened this issue Mar 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@capital-G
Copy link
Member

Currently I can not build this website locally based on the current main branch.

❯ npm install
npm WARN deprecated [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
npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead

> postinstall
> nuxt prepare

Nuxi 3.3.0                                                            01:56:27
✔ Types generated in .nuxt                                            01:56:30

added 1139 packages, and audited 1140 packages in 1m

305 packages are looking for funding
  run `npm fund` for details

1 high severity vulnerability

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

❯ du -sh node_modules
375M	node_modules

❯ npm run build

> build
> nuxt build

Nuxi 3.3.0                                                            01:56:44
Nuxt 3.3.0 with Nitro 2.3.1                                           01:56:44
ℹ Building client...                                                  01:56:48
ℹ vite v4.1.4 building for production...                              01:56:48
ℹ ✓ 252 modules transformed.                                          01:56:53
...
✔ Server built in 3658ms                                              01:56:57
✔ Generated public .output/public                               nitro 01:56:57
ℹ Initializing prerenderer                                      nitro 01:56:57

 ERROR  Named export 'postprocess' not found. The requested module 'file:///Users/scheiba/github/gencaster.github.io/node_modules/micromark/lib/postprocess.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'file:///Users/scheiba/github/gencaster.github.io/node_modules/micromark/lib/postprocess.js';
const { postprocess } = pkg;


  import { postprocess } from 'node_modules/micromark/lib/postprocess.js';
  ^^^^^^^^^^^
  SyntaxError: Named export 'postprocess' not found. The requested module 'node_modules/micromark/lib/postprocess.js' is a CommonJS module, which may not support all module.exports as named exports.
  CommonJS modules can always be imported via the default export, for example using:

  import pkg from 'node_modules/micromark/lib/postprocess.js';
  const { postprocess } = pkg;

  at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
  at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
  at async Promise.all (index 0)
  at async ESMLoader.import (node:internal/modules/esm/loader:527:24)
  at async prerender (node_modules/nitropack/dist/shared/nitro.5bf777ca.mjs:4131:26)
  at async node_modules/nuxt/dist/index.mjs:2111:7
  at async build (node_modules/nuxt/dist/index.mjs:2928:5)
  at async Object.invoke (node_modules/nuxi/dist/chunks/build.mjs:59:5)
  at async _main (node_modules/nuxi/dist/cli.mjs:49:20)


❯ node --version
v18.9.0

Dev server also fails to run.

Using yarn seems to work somehow... [it is really time to bury the node ecosystem...]

@capital-G capital-G added the bug Something isn't working label Mar 15, 2023
@vin-ni
Copy link
Member

vin-ni commented Aug 14, 2023

Could you check this again using yarn install?
Using npm install would conflict with the yarn.lock file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants