How fix error throw new ERR_MODULE_NOT_FOUND(

I use node js server/server.ts
import express, {Response } from 'express';
import Stripe from 'stripe';
import { createClient } from '@supabase/supabase-js';
import './dotenv';
require('dotenv').config();
import express, {Response } from 'express';
import Stripe from 'stripe';
import { createClient } from '@supabase/supabase-js';
import './dotenv';
require('dotenv').config();
I got this error
└─$ npm run start-server

> [email protected] start-server
> ts-node-esm server.ts

/media/kali/SSD_256GB/WEB/23_store/server/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:366
throw new ERR_MODULE_NOT_FOUND(
^
CustomError: Cannot find module '/media/kali/SSD_256GB/WEB/23_store/server/dotenv' imported from /media/kali/SSD_256GB/WEB/23_store/server/server.ts
└─$ npm run start-server

> [email protected] start-server
> ts-node-esm server.ts

/media/kali/SSD_256GB/WEB/23_store/server/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:366
throw new ERR_MODULE_NOT_FOUND(
^
CustomError: Cannot find module '/media/kali/SSD_256GB/WEB/23_store/server/dotenv' imported from /media/kali/SSD_256GB/WEB/23_store/server/server.ts
help me fix this
1 Reply
13eck
13eck16mo ago
This has nothing to do with HTML and since you're trying to import express and supabase it doesn't seem like front-end at all. Better to post in #back-end
Want results from more Discord servers?
Add your server