I am trying to load this module using: const pLimit = require("p-limit");
However when I do that I get the following error:
import Queue from 'yocto-queue';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:1116:16)
at Module._compile (internal/modules/cjs/loader.js:1164:27)
at Object.intercept [as .js] (/home/hamzaafridi/Workspace/app.vetdrive.co/master/node_modules/amdefine/intercept.js:30:12)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at Module.Hook._require.Module.require (/home/hamzaafridi/.npm/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:80:39)
at require (internal/modules/cjs/helpers.js:73:18)
at Object.<anonymous> (/master/src/server/modules/print.js:2:16)
I am trying to load this module using:
const pLimit = require("p-limit");
However when I do that I get the following error:
Can someone please help?
Thanks!