nativescript-angular icon indicating copy to clipboard operation
nativescript-angular copied to clipboard

ERROR in error TS5060: Option 'paths' cannot be used without specifying '--baseUrl' option

Open adams-family opened this issue 5 years ago • 6 comments
trafficstars

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: tns --version = 6.7.8
  • Cross-platform modules: @nativescript/core has 7.0.0-rc.33 version and is up to date
  • Android Runtime: tns-android is not installed
  • iOS Runtime: tns-ios has 6.5.2 version and is up to date
  • Plugin(s): -
  • NativeScript-Angular: 10.0.0
  • Angular: 10.0.4

Describe the bug tns run ios throws:

ERROR in error TS5060: Option 'paths' cannot be used without specifying '--baseUrl' option.

To Reproduce

ng new -c=@nativescript/schematics test2
cd test2
npm i
tns run ios   # throws incompatibility
tns migrate
tns run ios   # throws the error above

Expected behavior The application should start in an iOS simulator.

Sample project This is a bare empty project generated by the commands above.

adams-family avatar Jul 30 '20 11:07 adams-family

I'm having the same issue

iMarwan-k avatar Sep 02 '20 19:09 iMarwan-k

Anyone get a solution?

Sothecom avatar Sep 11 '20 14:09 Sothecom

Just in case anyone is still struggling with this, one of the many things I've changed is that although every documentation says you should no longer need the tsconfig.json, you still do. Also the tsconfig.tns.json Good news is there's actually light at the end of the tunnel. I'm struggling with getting a properly working baseline for Angular10 but I did get to the point where web, android and ios were at least loading. I will try to share this as soon as I get a coundown timer working as well

Sothecom avatar Sep 14 '20 18:09 Sothecom

Just in case anyone is still struggling with this, one of the many things I've changed is that although every documentation says you should no longer need the tsconfig.json, you still do. Also the tsconfig.tns.json Good news is there's actually light at the end of the tunnel. I'm struggling with getting a properly working baseline for Angular10 but I did get to the point where web, android and ios were at least loading. I will try to share this as soon as I get a coundown timer working as well

Hey, did you manage to fully run your project

iMarwan-k avatar Oct 09 '20 16:10 iMarwan-k

is there any update on this?

  • created a fresh project using ng new --collection=@nativescript/schematics my-mobile-app

  • then I do 'tns run android'

I get this same error without modifying anything.

is there any update on this?

eevan7a9 avatar Nov 05 '20 05:11 eevan7a9

Same problem. Change 2 files: tsconfig.json and nativescript.config.json. See below and than it will work

You have to change file tsconfig.json. add: "baseUrl": ".",

{ "compilerOptions": { "module": "ESNext", "target": "es2015", "moduleResolution": "node", "experimentalDecorators": true, "emitDecoratorMetadata": true, "skipLibCheck": true, "noEmitHelpers": true, "noEmitOnError": true, "baseUrl": ".", "lib": [ "es2015", "dom", "es6" ] }, "exclude": [ "node_modules", "platforms" ] }

and change file: nativescript.config.json change the appResourcesPath: 'app/App_Resources' (add app folder)

nativescript.config.json

import { NativeScriptConfig } from '@nativescript/core';

export default { id: 'org.nativescript.mymobileapp', appResourcesPath: 'app/App_Resources', android: { v8Flags: '--expose_gc', markingMode: 'none', }, appPath: 'app' } as NativeScriptConfig;

Robernator avatar Apr 14 '21 10:04 Robernator