Your message dated Fri, 9 Feb 2024 01:16:52 +0100
with message-id
<cajxtcxzogpwrv5f41soed51pacik_wekp-_hpgg8vh4a6z9...@mail.gmail.com>
and subject line Re: Bug#1063503: ERR_MODULE_NOT_FOUND when importing
@babel/core in module
has caused the Debian Bug report #1063503,
regarding ERR_MODULE_NOT_FOUND when importing @babel/core in module
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1063503: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1063503
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: node-babel7
Version: 7.20.15+ds1+~cs214.269.168-6
I'm trying to use a project that uses babel, importing it as a module as
stated on babel docs [1]:
However, when loading something as simple as:
❯ cat /tmp/foo.mjs
import { transform } from "@babel/core";
console.log(transform)
❯ node /tmp/babel.mjs
node:internal/process/esm_loader:40
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@babel/core' imported
from /tmp/babel.mjs
Did you mean to import @babel/core/lib/index.js?
at new NodeError (node:internal/errors:405:5)
at packageResolve (node:internal/modules/esm/resolve:916:9)
at moduleResolve (node:internal/modules/esm/resolve:973:20)
at defaultResolve (node:internal/modules/esm/resolve:1193:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:403:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:372:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:249:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:39)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v18.19.0
---
Now, using require("@babel/core") things work, but indeed, it (and its
plugisn) should work as ES modules too.
[1] https://babeljs.io/docs/babel-core
--- End Message ---
--- Begin Message ---
Le ven. 9 févr. 2024 à 01:12, Marco Trevisan <[email protected]> a écrit :
> Package: node-babel7
> Version: 7.20.15+ds1+~cs214.269.168-6
>
> I'm trying to use a project that uses babel, importing it as a module as
> stated on babel docs [1]:
>
Contrary to require, there are no global paths for imports (and that is
actually nice).
You can use
pkgjs-ln @babel/core
or in a project with package.json
pkgjs-install(-minimal ?)
--- End Message ---
--
Pkg-javascript-devel mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel