Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
Uncaught SyntaxError: Cannot use import statement outside a module (Trying to use Shepard.js Library )

I am trying to use Shepard.js for my web app.

I have installed the package using:

npm install shepherd.js --save

And I can see the folder in the node_modules folder in my web app's directory:

/Users/xxx/Desktop/Coding/anybody/anybody1/node_modules/shepherd.js

I have also checked I have node.js installed which I do.

When I try to follow the usage part of the Shepard Docs and add it to my js file I get this error:

Uncaught SyntaxError: Cannot use import statement outside a module

Here is how I have added it to my .js file:

import Shepherd from 'shepherd.js';

const tour = new Shepherd.Tour({
  defaultStepOptions: {
    classes: 'shadow-md bg-purple-dark',
    scrollTo: true
  }
});

tour.addStep({
  id: 'example-step',
  text: 'This step is attached to the bottom of the <code>.example-css-selector</code> element.',
  attachTo: {
    element: '#vygr-nav',
    on: 'bottom'
  },
  classes: 'example-step-extra-class',
  buttons: [
    {
      text: 'Next',
      action: tour.next
    }
  ]
});

tour.start();

I'm not quite sure what I'm doing wrong - this is my first time installing a library in JavaScript.

Thanks in advance for any help

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!