title: Why am I getting the 'SyntaxError: Cannot use import statement outside a module' error while using the cloudinary module?
body: <p>I am trying to call the cloudinary module to resize an image. This is my code:</p>
  <pre><code>import cloudinary from 'cloudinary';
  var cl = new cloudinary.Cloudinary({ cloud_name: &quot;username&quot;, secure: true });
  new CloudinaryImage(&quot;pingu.jpg&quot;).resize(scale().width(70).height(53));
  </code></pre>
  <p>Here's the error I'm getting:</p>
  <pre><code>  (node:29424) Warning: To load an ES module, set &quot;type&quot;: &quot;module&quot; in the package.json or use the .mjs extension.
  (Use `node --trace-warnings ...` to show where the warning was created)
  c:\Users\...\perspective\cloud.js:1
  import cloudinary from 'cloudinary';
  ^^^^^^
  
  SyntaxError: Cannot use import statement outside a module
      at wrapSafe (node:internal/modules/cjs/loader:1018:16)
      at Module._compile (node:internal/modules/cjs/loader:1066:27)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
      at Module.load (node:internal/modules/cjs/loader:967:32)
      at Function.Module._load (node:internal/modules/cjs/loader:807:14)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
      at node:internal/main/run_main_module:17:47
  
  [Done] exited with code=1 in 0.183 seconds
  </code></pre>
  <p>Can anyone tell me why I'm getting this specific error?</p>