0
votes

Hi I am trying to add a plugin to implement Mixpanel analytics inside my app.

I am running Nativescript version 6 and added @nstudio/nativescript-mixpanel version 2.1.0. Getting this error even though my tslint is able to find the module properly.

Cannot find module '@nstudio/nativescript-mixpanel'

Import in main.js

import {
  NativeScriptMixpanel,
  NativeScriptMixpanelPeople,
} from "@nstudio/nativescript-mixpanel";
    
const MIXPANEL_TOKEN = "KEY";
NativeScriptMixpanel.init(MIXPANEL_TOKEN);

package.json

"dependencies": {
  "@nstudio/nativescript-mixpanel": "^2.1.0",
1

1 Answers

0
votes

I have not used Vue NativeScript, however in Vue you would need a slash after the "@"

so

import {
  NativeScriptMixpanel,
  NativeScriptMixpanelPeople,
} from "@nstudio/nativescript-mixpanel";
    
const MIXPANEL_TOKEN = "KEY";
NativeScriptMixpanel.init(MIXPANEL_TOKEN);

would become

import {
  NativeScriptMixpanel,
  NativeScriptMixpanelPeople,
} from "@/nstudio/nativescript-mixpanel";
    
const MIXPANEL_TOKEN = "KEY";
NativeScriptMixpanel.init(MIXPANEL_TOKEN);