You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, maybe this is a very dumb question, but I can't figure out how to test this package.
If I manually load it in Node using require, after installing with npm i unitmath:
> require('unitmath')
/dev/shm/unitmath/node_modules/unitmath/index.js:1
import UnitMath from './src/Unit.js'
^^^^^^
Uncaught:
SyntaxError: Cannot use import statement inside the Node.js REPL, alternatively use dynamic import:
>
Node using import:
> await import ("unitmath")
(node:145890) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
Uncaught [SyntaxError: Unexpected token (1:13)
] {
pos: 13,
loc: Position { line: 1, column: 13 },
raisedAt: 23
}
Deno using import:
> await import('unitmath')
Uncaught TypeError: 'import', and 'export' cannot be used outside of module code at file:///dev/shm/unitmath/node_modules/.deno/unitmath@1.0.1/node_modules/unitmath/index.js:1:1
import UnitMath from './src/Unit.js'
~~~~~~
at async <anonymous>:1:22
The same seem to occur when running a .js or .mjs file with the following content:
Hello, maybe this is a very dumb question, but I can't figure out how to test this package.
If I manually load it in Node using
require
, after installing withnpm i unitmath
:Node using
import
:Deno using
import
:The same seem to occur when running a
.js
or.mjs
file with the following content:What am I doing wrong?
The text was updated successfully, but these errors were encountered: