TypeError: jwt.sign is not a function help guys

generateToken.js

    const jwt = require('jsonwebtoken');
  const generateToken = (id) => {
return jwt.sign({ id }, process.env.JWT_SECRET, {
    expiresIn: '30d'
});
 };
  module.exports = generateToken;

userController.js

 const asyncHandler = require('express-async-handler')
 const User = require("../Models/userModal");
 const generateToken = require('../utils/generateToken');




const authUser = asyncHandler(async (req, res) => {
const { email, password } = req.body;

const user = await User.findOne({ email });

if (user && (await user.matchPassword(password))) {
    res.json({
        _id: user._id,
        name: user.name,
        email: user.email,
        token: generateToken(user._id),
    });
  } else {
    res.status(401);
    throw new Error("Invalid Email or Password");
}
});


 const registerUser = asyncHandler(async (req, res) => {
const { name, email, password, } = req.body;

const userExists = await User.findOne({ email });

if (userExists) {
    res.status(404);
    throw new Error("User already exists");
}

const user = await User.create({
    name,
    email,
    password,
});

if (user) {
    res.status(201).json({
        _id: user._id,
        name: user.name,
        email: user.email,
        token: generateToken(user._id),
    });
 } else {
    res.status(400);
    throw new Error("User not found");
}
});

module.exports = { registerUser, authUser }

userModel

const mongoose = require('mongoose')
const bcrypt = require('bcryptjs')

const userSchema = mongoose.Schema(
 {
    name: {
        type: String,
        required: true
    },
    email: {
        type: String,
        required: true,
        unique: [true, 'The email is unique']

    },
    password: {
        type: String,
        required: true
    },
  }
);
userSchema.pre('save', async function (next) {
if (this.isModified('password')) {
    next();
}
const salt = await bcrypt.genSalt(10);
this.password = await bcrypt.hash(this.password, salt);
 });
 userSchema.methods.matchPassword = async function (enteredPassword) {
return await bcrypt.compare(enteredPassword, this.password);
};

const User = mongoose.model('user', userSchema);
module.exports = User;

.env

JWT_SECRET:'piyush1234'

And here’s the error in postman

{

TypeError: jwt.sign is not a function
   at generateToken (C:UsersYassine JedidiDesktopprojet alaserverutilsgenerateToken.js:3:16)
   at C:UsersYassine JedidiDesktopprojet alaserverControllersuserControllers.js:50:20
   at runMicrotasks (<anonymous>)
   at processTicksAndRejections (internal/process/task_queues.js:93:5)

}