Es6 Imports For Jwt
I'm making a nodeJS web app and I'm using JWT for authentication. All my work is in ES6 modules and I wanted to import JWT in the same way, but apparently it isn't yet supported by
Solution 1:
Could you try something:
- Create a folder
- Do
npm init - Create a file
app.js - install json web token
npm i jsonwebtoken - Go to
package.jsonand add"type": "module" - write in your
app.jsthis here:import jwt from "jsonwebtoken" - Execute it:
node --experimental-modules app.js
Tell me then if you get an error
Post a Comment for "Es6 Imports For Jwt"