Code Monkey home page Code Monkey logo

capacitor's Introduction

capacitor's People

Contributors

janoshrubos avatar nathanwalker avatar rvanzon avatar tdermendjiev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

capacitor's Issues

cant import @nativescript/core/profiling

esm5 issues when importing into dialog example

i tried to create a dialog with Profiling.time()

Reproduction steps
install in root and/or in nativescript tns-core-modules (i tried both)
replace the dialog code for the generated example in src/nativescript/examples/modal

import {
  iosRootViewController,
  androidCreateDialog,
} from '@nativescript/capacitor/bridge';
import { time } from 'tns-core-modules/profiling';
// import { time } from '@nativescript/core/profiling';
/**
 * Try calling from Ionic with:
 *
 * import { native } from '@nativescript/capacitor';
 * 
 *
 * native.openNativeModalView();
 *
 * Reference:
 * iOS: https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/index.html
 * Android: https://developer.android.com/reference/android/widget/LinearLayout
 */

native.openNativeModalView = () => {
  if (native.isAndroid) {
    androidCreateDialog(() => {
      const activity = native.androidCapacitorActivity;

      const layout = new android.widget.LinearLayout(activity);
      layout.setGravity(android.view.Gravity.CENTER);
      layout.setOrientation(android.widget.LinearLayout.VERTICAL);

      const btn = new android.widget.Button(activity);
      btn.setText('Ionic');
      layout.addView(btn);

      const btn1 = new android.widget.Button(activity);
      btn1.setText('Capacitor');
      layout.addView(btn1);

      return layout;
    });
  } else {
    const vc = UIViewController.alloc().init();
    vc.view.backgroundColor = UIColor.blueColor;
    const label = UILabel.alloc().initWithFrame(
      CGRectMake(0, 30, UIScreen.mainScreen.bounds.size.width, 50)
    );
    label.text = `Well this is fun. ${time()}`;
    label.textColor = UIColor.orangeColor;
    label.textAlignment = NSTextAlignment.Center;
    label.font = UIFont.systemFontOfSize(35);
    vc.view.addSubview(label);
    iosRootViewController().presentModalViewControllerAnimated(vc, true);
  }
};

Error Cannot read properties of undefined (reading 'join') in webpack plugin

When following the Nativescript for Capacitor installation instructions, the script npm run build:mobile (after fixing #28 and #29) errors with this message:

[webpack-cli] TypeError: Cannot read properties of undefined (reading 'join')
    at PlatformSuffixPlugin.apply (C:\Users\NAME\Projects\PROJECT\node_modules\@nativescript\webpack\dist\plugins\PlatformSuffixPlugin.js:28:61)
    at createCompiler (C:\Users\NAME\Projects\PROJECT\node_modules\webpack\lib\webpack.js:76:12)
    at create (C:\Users\NAME\Projects\PROJECT\node_modules\webpack\lib\webpack.js:143:16)
    at webpack (C:\Users\NAME\Projects\PROJECT\node_modules\webpack\lib\webpack.js:151:47)
    at WebpackCLI.f [as webpack] (C:\Users\NAME\Projects\PROJECT\node_modules\webpack\lib\index.js:73:16)
    at WebpackCLI.createCompiler (C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\webpack-cli.js:1789:29)
    at async WebpackCLI.runWebpack (C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\webpack-cli.js:1890:20)
    at async Command.<anonymous> (C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\webpack-cli.js:912:21)
    at async Promise.all (index 1)
    at async Command.<anonymous> (C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\webpack-cli.js:1372:13)
NativeScript build complete: undefined/nativescript/index.js

It looks like the error is coming from this line:

https://github.com/NativeScript/NativeScript/blob/db0a852f5bee60a306b4e3cb14664b6ac32601a2/packages/webpack5/src/plugins/PlatformSuffixPlugin.ts#L35

Where extensions is undefined.

My guess is that somewhere in https://github.com/NativeScript/capacitor/blob/main/src_bridge/webpack.config.js, an option needs to be added.

Capacitor 4 version

Hello,

I am working on an application using capacitor 4. It would help a lot if the capacitor version was bumped to v4.

Thanks for the work !

Automatically added npm script build:nativescript does not work on Windows

First reported here: NativeScript/capacitor-docs#14

When following the Nativescript for Capacitor installation instructions, the postinstall step for npm i @nativescript/capacitor adds an npm script that does not work on Windows (and maybe other platforms?).

Running npm run build:mobile further along in the instructions, it will error.

> [email protected] build:nativescript
> node --experimental-import-meta-resolve node_modules/.bin/build-nativescript

C:\Users\NAME\Projects\PROJECT\node_modules\.bin\build-nativescript:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at internalCompileFunction (node:internal/vm:77:18)
    at wrapSafe (node:internal/modules/cjs/loader:1288:20)
    at Module._compile (node:internal/modules/cjs/loader:1340:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49

Node.js v20.10.0
ERROR: "build:nativescript" exited with 1.

This is caused by the npm script that looks like this:

"build:nativescript": "node --experimental-import-meta-resolve node_modules/.bin/build-nativescript",

It tries to call node_modules/.bin/build-nativescript using Node, but node_modules/.bin/build-nativescript is a shell script.

The line that causes the problem:

'build:nativescript': `node --experimental-import-meta-resolve node_modules/.bin/build-nativescript`,

The npm script should be changed to call node_modules/.bin/build-nativescript as a regular shell script, or directly call node_modules/@nativescript/capacitor/bin/build-nativescript.mjs using this:

"build:nativescript": "node --experimental-import-meta-resolve node_modules/@nativescript/capacitor/bin/build-nativescript.mjs",

( The correct command errors with another message, but that is a separate issue )

Android native calls seem to not work. NativeCapEvents are produced, but no native functions are being called.

General info

Device: Xiaomi Redmi 5
package.json:

{
  "name": "nativescript-capacitor-ionic",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "build:nativescript": "build-nativescript",
    "build:mobile": "npm-run-all build build:nativescript"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~12.0.1",
    "@angular/core": "~12.0.1",
    "@angular/forms": "~12.0.1",
    "@angular/platform-browser": "~12.0.1",
    "@angular/platform-browser-dynamic": "~12.0.1",
    "@angular/router": "~12.0.1",
    "@capacitor/android": "^3.1.1",
    "@capacitor/app": "1.0.2",
    "@capacitor/core": "3.1.1",
    "@capacitor/haptics": "1.0.2",
    "@capacitor/keyboard": "1.0.2",
    "@capacitor/status-bar": "1.0.2",
    "@ionic/angular": "^5.5.2",
    "@nativescript/capacitor": "^1.0.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~12.0.1",
    "@angular-eslint/builder": "~12.0.0",
    "@angular-eslint/eslint-plugin": "~12.0.0",
    "@angular-eslint/eslint-plugin-template": "~12.0.0",
    "@angular-eslint/template-parser": "~12.0.0",
    "@angular/cli": "~12.0.1",
    "@angular/compiler": "~12.0.1",
    "@angular/compiler-cli": "~12.0.1",
    "@angular/language-service": "~12.0.1",
    "@capacitor/cli": "3.1.1",
    "@ionic/angular-toolkit": "^4.0.0",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "@typescript-eslint/eslint-plugin": "4.16.1",
    "@typescript-eslint/parser": "4.16.1",
    "eslint": "^7.6.0",
    "eslint-plugin-import": "2.22.1",
    "eslint-plugin-jsdoc": "30.7.6",
    "eslint-plugin-prefer-arrow": "1.2.2",
    "jasmine-core": "~3.7.1",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.3.2",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "typescript": "~4.2.4"
  },
  "description": "An Ionic project"
}

Problem

I've created fresh project following exact steps from: https://capacitor.nativescript.org/installation.html (except: I've generated blank application instead of tabs). Everything went flawlessly except native functions aren't getting called. I've been cleaning project and Android Studio, updating nativescript and capacitor dependencies and also playing around with gradle version, but in the end that didn't affect anything. I've followed guide twice ensuring calling npm i @nativescript/capacitor after npx cap add android.

home.page.ts

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {

  constructor() {}

  async doStuff() {
    console.log(`START!`);
    const brightness = Math.round(Math.random() * 100);
    console.log(`SET BRIGHTNESS TO!`, brightness);
    native.setScreenBrightness(brightness);
    native.openNativeModalView();

    console.log(1, native.isAndroid);

    console.log(`END!`);
  }

}

After activating action:
image

There are a lot of events sent to NativeScriptCap.notify when I activate that function, but even simplest native.isAndroid returns undefined, brightness isn't changed and modal isn't opening. Code for brightness and modal are copy-pasted from documentation and imported in nativescript/index.ts.

Error during `npm install @nativescript/capacitor`

System

  • macOS 10.15
  • Node v16.1.0
  • shell: zsh

Initialising the repo

# Initialise Svelte web app
npx degit sveltejs/template svelte-app
cd svelte-app

# Install Capacitor:
npm install @capacitor/cli@latest @capacitor/core@latest @capacitor/android@latest @capacitor/ios@latest

# As discussed in https://github.com/NativeScript/capacitor-docs/issues/5, this extra
# step isn't in the NativeScript Capacitor instructions but is required.
npx cap init

# build at least once before adding platforms
npm run build

npx cap add android
npx cap add ios

npx cap sync

Installing @nativescript/capacitor

$ npm install @nativescript/capacitor
npm WARN deprecated [email protected]: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

> [email protected] install /Users/jamie/Downloads/svelte-capacitor-app/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js

(node:82724) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node

> [email protected] postinstall /Users/jamie/Downloads/svelte-capacitor-app/node_modules/ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)


> @nativescript/[email protected] postinstall /Users/jamie/Downloads/svelte-capacitor-app/node_modules/@nativescript/webpack
> node postinstall.js

Skipping postinstall artifacts! We assumed the @nativescript/webpack is installing devDependencies

> @nativescript/[email protected] postinstall /Users/jamie/Downloads/svelte-capacitor-app/node_modules/@nativescript/capacitor
> node dist/esm/postinstall --action install

⚙️   @nativescript/capacitor installing...
ADDED: src/nativescript
UPDATED: package.json
ADDED: src/native-custom.d.ts
UPDATED: .gitignore
UPDATED: ios/App/App/AppDelegate.swift

✅   iOS Ready

✅   Android Ready

> @nativescript/[email protected] postinstall /Users/jamie/Downloads/svelte-capacitor-app/src/nativescript/node_modules/@nativescript/core
> node cli-hooks/postinstall.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN nativescript@ No description
npm WARN nativescript@ No repository field.
npm WARN nativescript@ No license field.

added 24 packages from 47 contributors and audited 24 packages in 6.396s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

[!] Error: Cannot find module 'typescript/package.json' from '/Users/jamie/Downloads/svelte-capacitor-app/src/nativescript'
⭐ @nativescript/capacitor ⭐


🧠   Learn more:   👉   https://capacitor.nativescript.org/getting-started.html


npm WARN [email protected] requires a peer of typescript@>=2.7 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>2.7.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.

+ @nativescript/[email protected]
added 769 packages from 395 contributors and audited 945 packages in 67.785s

59 packages are looking for funding
  run `npm fund` for details

found 13 vulnerabilities (1 low, 11 moderate, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details

This catches my eye:

[!] Error: Cannot find module 'typescript/package.json' from '/Users/jamie/Downloads/svelte-capacitor-app/src/nativescript'

I'm not sure what the consequences of that failure are. I may try again in a moment with Node v14.6.0.

build-nativescript.mjs can not find webpack.config.js on Windows

When following the Nativescript for Capacitor installation instructions, the script npm run build:mobile (after fixing #28) errors with this message:

[webpack-cli] Failed to load 'C:\C:\Users\NAME\Projects\PROJECT\node_modules\@nativescript\capacitor\bridge\webpack.config.js' config
[webpack-cli] Error: Cannot find module 'C:\C:\Users\NAME\Projects\PROJECT\node_modules\@nativescript\capacitor\bridge\webpack.config.js'
Require stack:
- C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\webpack-cli.js
- C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\bootstrap.js
- C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\bin\cli.js
- C:\Users\NAME\Projects\PROJECT\node_modules\webpack\bin\webpack.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at WebpackCLI.tryRequireThenImport (C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\webpack-cli.js:204:22)
    at loadConfigByPath (C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\webpack-cli.js:1404:38)
    at C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\webpack-cli.js:1454:88
    at Array.map (<anonymous>)
    at WebpackCLI.loadConfig (C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\webpack-cli.js:1454:68)
    at WebpackCLI.createCompiler (C:\Users\NAME\Projects\PROJECT\node_modules\webpack-cli\lib\webpack-cli.js:1785:33) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\NAME\\Projects\\PROJECT\\node_modules\\webpack-cli\\lib\\webpack-cli.js',
    'C:\\Users\\NAME\\Projects\\PROJECT\\node_modules\\webpack-cli\\lib\\bootstrap.js',
    'C:\\Users\\NAME\\Projects\\PROJECT\\node_modules\\webpack-cli\\bin\\cli.js',
    'C:\\Users\\NAME\\Projects\\PROJECT\\node_modules\\webpack\\bin\\webpack.js'
  ]
}
NativeScript build complete: undefined/nativescript/index.js

Note the double C:\C:\ in the pathname.

This is caused by this line:

const cmdArgs = ['webpack', `--config=${url.pathname}`, ...args];

It outputs

--config=/C:/Users/jeroe/Projects/port-alert-mobile/node_modules/@nativescript/capacitor/bridge/webpack.config.js

It should be possible to edit the above line to output the correct path on all platforms.

For example:

const cmdArgs = ['webpack', `--config=${fileURLToPath(url.toString())}`, ...args];

fileURLToPath from node:url should correctly turn the URL into a valid path.

`Interaction` will not work after about 15 seconds

My code defined in src/nativescript/utils

After call native.enablePencilTap() I can see log when tap the apple pencil, but about 15 seoncds it does not work any more. I have to recall native.enablePencilTap() to make it work again.

It's that normal? Can I find a way to always to interaction with apple pencil?

import { iosRootViewController } from '@nativescript/capacitor/bridge';

let showLog: () => void;

@NativeClass()
class UIPencilInteractionDelegateClass extends NSObject {
  public static ObjCProtocols = [UIPencilInteractionDelegate];

  pencilInteractionDidTap(_interaction: UIPencilInteraction) {
    console.log(UIPencilInteraction.preferredTapAction);
    showLog();
  }
}

native.enablePencilTap = (cb: () => void) => {
  if (native.isAndroid) {
    return;
  }
  showLog = cb;
  const uiPencilR = UIPencilInteraction.alloc().init();
  uiPencilR.delegate = UIPencilInteractionDelegateClass.new();
  iosRootViewController().view.addInteraction(uiPencilR);
};

Nativescript does not seem to work in Android

Hello,
I followed the "get started" guide and created a simple capacitor app to test out nativescript. But when firing the "openNativeModalView" nothing happens.
I guess my issue would be very similar to #6 and since you asked for a repo there, here is my project to check out: https://drive.google.com/file/d/1zyZhjz7J3TgQIJR19oTO8EP5sR7ociNO/view?usp=sharing

I am trying with capacitor 4, nativescript 4 after I saw warning message that capacitor 5 is not yet fully supported. I initially thought that was the problem, but it turns out not to be so.

install fails when tsconfig.json contains a trailing comma

For whatever reason, tsconfig.json is allowed to contain comments and trailing commas. The upstream default even has them. When I do npm install @nativescript/capacitor it works with comments, but fails with a poor error message if there is a trailing comma.

npm ERR! path /.../node_modules/@nativescript/capacitor
npm ERR! command failed
npm ERR! command sh -c node dist/esm/postinstall --action install
npm ERR! ⚙️   @nativescript/capacitor installing...
npm ERR! undefined:44
npm ERR! }
npm ERR! ^
npm ERR!
npm ERR! SyntaxError: Unexpected token } in JSON at position 1186
npm ERR!     at JSON.parse (<anonymous>)
npm ERR!     at addProjectManagedNativeScript (/home/dev/repo/apps/android/svelte-capacitor-git/node_modules/@nativescript/capacitor/dist/esm/postinstall.js:137:39)
npm ERR!     at Object.<anonymous> (/home/dev/repo/apps/android/svelte-capacitor-git/node_modules/@nativescript/capacitor/dist/esm/postinstall.js:565:5)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1097:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:975:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR!     at node:internal/main/run_main_module:17:47
npm ERR!
npm ERR! Node.js v17.2.0

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dev/.npm/_logs/2022-04-29T12_17_23_659Z-debug.log
  • @nativescript/capacitor 2.0.2

Build errors

I get many errors when run yarn build:mobile

image

I can build yarn build:nativescript but I can not build my web project any more. What should I do, please help

this is my project's dependencies

 "dependencies": {
    "cross-gesture": "^1.3.3",
    "react": "^17.0.0",
    "react-dom": "^17.0.0",
    "rxh": "^1.0.1",
    "rxjs": "^7.3.0",
    "@capacitor/android": "^3.2.0",
    "@capacitor/app": "^1.0.2",
    "@capacitor/cli": "^3.2.0",
    "@capacitor/core": "^3.2.0",
    "@capacitor/ios": "^3.2.0",
    "@capacitor/status-bar": "^1.0.2",
    "@capacitor/toast": "^1.0.2",
    "@nativescript/capacitor": "^1.0.0",
    "capacitor-plugin-filesharer": "^1.0.0"
  },
  "devDependencies": {
    "@types/react": "^17.0.19",
    "@types/react-dom": "^17.0.9",
    "@typescript-eslint/eslint-plugin": "^4.29.3",
    "@typescript-eslint/parser": "^4.29.3",
    "@vitejs/plugin-react-refresh": "^1.3.5",
    "cordova-res": "^0.15.3",
    "eslint": "^7.31.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^3.4.1",
    "eslint-plugin-react": "^7.24.0",
    "eslint-plugin-react-hooks": "^4.2.0",
    "husky": "^7.0.1",
    "prettier": "^2.3.2",
    "typescript": "^4.3.5",
    "vite": "^2.5.0"
  }

[webpack-cli] TypeError: Cannot read properties of undefined (reading 'join')

yarn build:mobile

[!] Files already patched with the latest version. For details, run: ts-patch check
[webpack-cli] TypeError: Cannot read properties of undefined (reading 'join')
at PlatformSuffixPlugin.apply (/Users/loremru/Desktop/ns-test/node_modules/@nativescript/webpack/dist/plugins/PlatformSuffixPlugin.js:28:61)
at createCompiler (/Users/loremru/Desktop/ns-test/node_modules/webpack/lib/webpack.js:76:12)
at create (/Users/loremru/Desktop/ns-test/node_modules/webpack/lib/webpack.js:143:16)
at webpack (/Users/loremru/Desktop/ns-test/node_modules/webpack/lib/webpack.js:151:47)
at WebpackCLI.f [as webpack] (/Users/loremru/Desktop/ns-test/node_modules/webpack/lib/index.js:72:16)
at WebpackCLI.createCompiler (/Users/loremru/Desktop/ns-test/node_modules/webpack-cli/lib/webpack-cli.js:1789:29)
at async WebpackCLI.runWebpack (/Users/loremru/Desktop/ns-test/node_modules/webpack-cli/lib/webpack-cli.js:1890:20)
at async Command. (/Users/loremru/Desktop/ns-test/node_modules/webpack-cli/lib/webpack-cli.js:912:21)
at async Promise.all (index 1)
at async Command. (/Users/loremru/Desktop/ns-test/node_modules/webpack-cli/lib/webpack-cli.js:1372:13)

{
  "name": "capacitor-app",
  "version": "1.0.0",
  "description": "An Amazing Capacitor App",
  "main": "index.js",
  "keywords": [
    "capacitor",
    "mobile"
  ],
  "scripts": {
    "start": "vite",
    "build": "vite build",
    "preview": "vite preview",
    "build:nativescript": "node --experimental-import-meta-resolve node_modules/.bin/build-nativescript",
    "build:mobile": "npm-run-all build build:nativescript",
    "dev:nativescript": "dev-nativescript"
  },
  "dependencies": {
    "@capacitor/android": "^5.5.1",
    "@capacitor/camera": "latest",
    "@capacitor/core": "latest",
    "@capacitor/ios": "^5.5.1",
    "@capacitor/splash-screen": "latest",
    "@nativescript/capacitor": "^5.0.2",
    "typescript": "^5.3.3"
  },
  "devDependencies": {
    "@capacitor/cli": "latest",
    "vite": "^2.9.13"
  },
  "author": "",
  "license": "ISC"
}
image

Cannot install with yarn and node 14

error /Users/***/Documents/Projects.nosync/Mimesis/node_modules/@nativescript/capacitor: Command failed.
Exit code: 1
Command: node dist/esm/postinstall --action install
Arguments: 
Directory: /Users/***/Documents/Projects.nosync/Mimesis/node_modules/@nativescript/capacitor
Output:
⚙️   @nativescript/capacitor installing...
undefined:14
    ],
    ^

SyntaxError: Unexpected token ] in JSON at position 293
    at JSON.parse (<anonymous>)
    at addProjectManagedNativeScript (/Users/***/Documents/Projects.nosync/Mimesis/node_modules/@nativescript/capacitor/dist/esm/postinstall.js:128:39)
    at Object.<anonymous> (/Users/***/Documents/Projects.nosync/Mimesis/node_modules/@nativescript/capacitor/dist/esm/postinstall.js:749:5)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.