This makes no sense. The file exists, but i just cannot import it. My code has a lot of imports in the same format, but only this one is failing.
[The code] (bin/hyp.js)
#!/usr/bin/env node
process.title = "hyp"
import subcommand from 'subcommand'
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
import * as hyper from '../lib/hyper/index.js'
import info from '../lib/commands/info.js'
import create from '../lib/commands/create.js'
import seed from '../lib/commands/seed.js'
import unseed from '../lib/commands/unseed.js'
import beam from '../lib/commands/beam.js'
import alias from '../lib/commmands/alias.js'
According to Node.js Documentation
You must either change the filename extension of the module to be .mjs, so change alias.js to be alias.mjs (and change the import as appropriate)
OR, you can add this config option to package.json:
"type": "module"
This will allow you to use include instead of require syntax.
If your importation alias is really a node modules you just have to import it like this "import alias from 'alias' ".