GithubHelp home page GithubHelp logo

tobua / create-react-native-plugin Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 518 KB

Template for creating React Native plugins without native code.

Home Page: https://www.npmjs.com/create-react-native-plugin

JavaScript 46.86% TypeScript 53.14%
react-native plugin javascript flowjs template boilerplate bootstrap

create-react-native-plugin's Introduction

create-react-native-plugin's People

Contributors

tobua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

create-react-native-plugin's Issues

Initializing a new plugin throws SyntaxError: The requested module 'fs' does not provide an export named 'cpSync'

Both npx create-react-native-plugin react-native-my-plugin and npm init -y react-native-plugin react-native-my-plugin fails on Node v.14.

file:///root/.npm/_npx/61060/lib/node_modules/create-react-native-plugin/index.js:3
import { existsSync, unlinkSync, rmdirSync, lstatSync, mkdirSync, cpSync, renameSync } from 'fs'
                                                                  ^^^^^^
SyntaxError: The requested module 'fs' does not provide an export named 'cpSync'
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:124:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:179:5)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)
    at async handleMainPromise (internal/modules/run_main.js:59:12)

Seems like cpSync was introduced in Node V.16 and support is still experimental. See https://nodejs.org/api/fs.html#fscpsyncsrc-dest-options.

node -v
v14.19.3
npm -v
6.14.17

I'll go ahead and upgrade my Node environment but I think it would benefit the community if this awesome plugin would use an api generally available for more node versions.

Initalizing a new plugin with V.2.0.5 fails because tsconfig-build.json is missing

# npx create-react-native-plugin react-native-my-plugin

node:fs:599
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open '/workspaces/react-native-my-plugin/tsconfig-build.json'
    at Object.openSync (node:fs:599:3)
    at readFileSync (node:fs:467:35)
    at replaceTemplateVariables (file:///root/.npm/_npx/c8e08ff0fcfedc7f/node_modules/create-react-native-plugin/customize.js:21:20)
    at Array.forEach (<anonymous>)
    at default (file:///root/.npm/_npx/c8e08ff0fcfedc7f/node_modules/create-react-native-plugin/customize.js:29:9)
    at file:///root/.npm/_npx/c8e08ff0fcfedc7f/node_modules/create-react-native-plugin/index.js:39:1
    at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:409:24)
    at async loadESM (node:internal/process/esm_loader:85:5) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/workspaces/react-native-my-plugin/tsconfig-build.json'
}

Changing to release 2.0.4 seems to do the trick: npx [email protected] react-native-my-plugin.

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.