Hey there, I recently started learning npm. I'm trying to install "@fullcalendar" and use it, but I keep getting this error message: "Uncaught TypeError: Failed to resolve module specifier "tslib". Relative references must start with either "/", "./", or "../"."
Here is the structure of my files: www/templates/node_modules/ www/templates/assets/calendar.js
This is the beginning of my calendar.js file:
import {Calendar} from '../node_modules/@fullcalendar/core/main.js';
dayGridPlugin from '../node_modules/@fullcalendar/daygrid/main.js';
timeGridPlugin from '../node_modules/@fullcalendar/timegrid/main.js';
listPlugin from '../node_modules/@fullcalendar/list/main.js';
other code
The error occurs when importing {Calendar}. Looking at @fullcalendar/core/main.js, I see:
import './vdom';
import { __extends, __assign } from 'tslib';
import { render, createElement, CalendarRoot, CustomContentRenderContext, CalendarContent, flushToDom, DelayedRunner, CalendarDataManager, isArraysEqual, applyStyleProp, CalendarApi } from '@fullcalendar/common';
export * from '@fullcalendar/common';
I believe the path to tslib (and other imported libraries) is incorrect. However, tslib is located in the directory www/templates/node_modules/tslib. I don't want to edit the installed package directly as I don't think that's the right approach. Is there a way to set the path in the npm config? Or what would be the best course of action?
Thank you, A.