0
votes

Okay, so I ran the command "ns migrate" to use a newer version of nativescript. What this does is remove the tns-core-modules dependency, which means I can't use it to import things anymore. Supposedly we're supposed to use @nativescript/core instead, but the problem is when I try to import objects @nativescript/core doesn't work and I'm greeted with "cannot find module '@nativescript/core' or its corresponding type declarations".

For example, this will not work:

import { Label } from "@nativescript/core";

But with the tns-core-modules dependency it worked and was as simple as:

import { Label } from "tns-core-modules/ui/label"

After running the ns migrate command it remove tns-core-modules and updates @nativescript/core to 7.3.0

Am I importing incorrectly??

1

1 Answers

1
votes
run npm install @nativescript/core

Then this should work

import { Label } from "@nativescript/core";

I use

import { ApplicationSettings, ImageSource } from '@nativescript/core';

in my recent project