Comments (26)
Okay, I was able to reproduce the bug by starting a project with [email protected]
The CLI used seems to be the one installed locally instead of the global one which is incompatible with the configuration in react-native-make.
I will be working on a workaround
from react-native-make.
Just added a compat layer for [email protected] and published it in 1.0.2.
A yarn add -D @bam.tech/react-native-make
should work ;)
I will be waiting for confirmation to close the issue
from react-native-make.
Just published a fix in 1.0.3
With Yarn, node_modules folder architecture is flat whereas with NPM it is nested
from react-native-make.
After installing via npm, I am unable to run
react-native set-icon
, I get this error:error Unrecognized command "set-icon". info Run "react-native --help" to see a list of all available commands.
+1.. I am too getting the same
from react-native-make.
Hello, is @bam.tech/react-native-make listed as a dev dependency in your react-native project?
This plugin works as an extension of the local react-native-cli. Which means that to run it you have to be in the project folder.
To check if it works, set-icon
should be listed when running react-native -h
from react-native-make.
Same error here. In package.json:
"devDependencies": {
"@bam.tech/react-native-make": "1.0.1-rc2",
React Native versiΓ³n is 0.59.10
Hope this helps clarify
from react-native-make.
Can you copy/paste the output when running react-native --version
?
Edit: For those encountering the issue I believe we are only compatible with up to date installs of react-native-cli. I'm waiting for confirmation but running npm install -g react-native-cli
should fix the issue.
from react-native-make.
react-native --version
output is:
react-native-cli: 2.0.1
react-native: 0.59.10
from react-native-make.
Ok, same here, so wrong hypothesis.
Can you give me the output of react-native -h
?
from react-native-make.
Here is the output:
# react-native -h
Usage: react-native [options] [command]
Options:
--version Print CLI version
--projectRoot [string] Path to the root of the project
--reactNativePath [string] Path to React Native
--verbose Increase logging verbosity
-h, --help output usage information
Commands:
start [options] starts the webserver
run-ios [options] builds your app and starts it on iOS simulator
run-android [options] builds your app and starts it on a connected Android emulator or device
new-library [options] generates a native library bridge
bundle [options] builds the javascript bundle for offline use
ram-bundle [options] builds javascript as a "Random Access Module" bundle for offline use
eject [options] Re-create the iOS and Android folders and native code
link [options] [packageName] scope link command to certain platforms (comma-separated)
unlink [options] <packageName> unlink native dependency
install [options] <packageName> install and link native dependencies
uninstall [options] <packageName> uninstall and unlink native dependencies
upgrade [options] [version] Upgrade your app's template files to the specified or latest npm version using `rn-diff-purge` project. Only valid semver versions are allowed.
log-android [options] starts adb logcat
log-ios [options] starts iOS device syslog tail
dependencies [options] lists dependencies
info [options] Get relevant version info about OS, toolchain and libraries
init [options]
Just in case it helps, my whole package.json:
{
"name": "DPE",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"clean": "rm -rf $TMPDIR/react-* && watchman watch-del-all && npm cache clean --force",
"clean:android": "cd android/ && ./gradlew clean && cd .. && react-native run-android",
"newclear": "rm -rf $TMPDIR/react-* && watchman watch-del-all && rm -rf ios/build && rm -rf node_modules/ && npm cache clean --force && npm i",
"test:watch": "jest --watch",
"updateSnapshot": "jest --updateSnapshot",
"coverage": "jest --coverage && open coverage/lcov-report/index.html || xdg-open coverage/lcov-report/index.html",
"android:build": "cd android && ./gradlew assembleRelease",
"android:install": "cd android && ./gradlew assembleRelease && ./gradlew installRelease",
"android:hockeyapp": "cd android && ./gradlew assembleRelease && puck -submit=auto app/build/outputs/apk/app-release.apk",
"android:devices": "$ANDROID_HOME/platform-tools/adb devices",
"android:logcat": "$ANDROID_HOME/platform-tools/adb logcat *:S ReactNative:V ReactNativeJS:V",
"android:shake": "$ANDROID_HOME/platform-tools/adb devices | grep '\\t' | awk '{print $1}' | sed 's/\\s//g' | xargs -I {} $ANDROID_HOME/platform-tools/adb -s {} shell input keyevent 82",
"storybook": "storybook start -p 7007",
"lint": "standard --verbose | snazzy",
"lintdiff": "git diff --name-only --cached --relative | grep '\\.js$' | xargs standard | snazzy",
"fixcode": "standard --fix",
"git-hook": "npm run lint -s && npm run test -s"
},
"dependencies": {
"@react-native-community/async-storage": "1.6.1",
"apisauce": "1.0.3",
"format-json": "1.0.3",
"i18n-js": "3.3.0",
"identity-obj-proxy": "3.0.0",
"lodash": "4.17.15",
"prop-types": "15.7.2",
"querystringify": "2.1.1",
"ramda": "0.26.1",
"react": "16.8.3",
"react-native": "0.59.10",
"react-native-config": "0.11.7",
"react-native-device-info": "2.3.2",
"react-native-fast-image": "6.1.1",
"react-native-firebase": "5.5.6",
"react-native-gesture-handler": "1.3.0",
"react-native-localize": "1.1.4",
"react-native-permissions": "1.2.0",
"react-native-splash-screen": "3.2.0",
"react-native-status-bar-height": "2.4.0",
"react-native-vector-icons": "6.6.0",
"react-native-webview": "5.8.2",
"react-navigation": "3.11.1",
"react-navigation-redux-helpers": "3.0.2",
"react-redux": "6.0.1",
"redux": "4.0.4",
"redux-persist": "5.10.0",
"redux-saga": "1.0.5",
"reduxsauce": "1.1.0",
"seamless-immutable": "7.1.4"
},
"devDependencies": {
"@babel/core": "7.5.5",
"@babel/runtime": "7.5.5",
"@bam.tech/react-native-make": "1.0.1-rc2",
"@storybook/addon-actions": "5.0.11",
"@storybook/addon-links": "5.0.11",
"@storybook/addon-storyshots": "4.1.18",
"@storybook/addons": "4.1.18",
"@storybook/channels": "4.1.18",
"@storybook/react-native": "4.1.18",
"babel-core": "6.26.3",
"babel-eslint": "7.1.1",
"babel-jest": "24.8.0",
"babel-plugin-ignite-ignore-reactotron": "0.3.0",
"babel-preset-env": "1.7.0",
"babel-preset-react-native": "4.0.1",
"enzyme": "3.10.0",
"enzyme-adapter-react-16": "1.14.0",
"ignite-andross": "4.1.0",
"ignite-redux-persist": "2.0.0",
"ignite-standard": "1.0.0",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.55.0",
"mockery": "2.1.0",
"react-devtools-core": "3.6.0",
"react-dom": "16.7.0",
"react-test-renderer": "16.8.3",
"reactotron-react-native": "2.2.0",
"reactotron-redux": "2.1.3",
"reactotron-redux-saga": "3.0.0",
"snazzy": "8.0.0",
"standard": "10.0.2"
},
"jest": {
"preset": "react-native",
"testMatch": [
"<rootDir>/Tests/**/*.js",
"**/?(*.)(spec|test).js?(x)"
],
"testPathIgnorePatterns": [
"/node_modules/",
"<rootDir>/Tests/Setup.js"
],
"moduleNameMapper": {
"^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "identity-obj-proxy"
},
"transform": {
"^.+\\.(js)$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
},
"setupFiles": [
"<rootDir>/Tests/Setup"
]
},
"config": {},
"standard": {
"parser": "babel-eslint",
"globals": [
"describe",
"test",
"jest",
"expect",
"fetch",
"navigator",
"__DEV__",
"XMLHttpRequest",
"FormData",
"React$Element"
]
},
"rnpm": {
"assets": [
"./assets/fonts"
]
}
}
from react-native-make.
Thanks, also, which platform are you working on? Windows? Mac? Linux?
from react-native-make.
Here goes with all other versions I think may help π :
MacOS Mojave 10.14.5
node v10.15.0
npm 6.11.3
Shell zsh
from react-native-make.
I am completely unable to reproduce the issue.
If you are able to dig in, the way it works is that when running "react-native " in a RN project's folder, it loads up node_modules checking against the presence of a react-native.config.js file in the root folder. This file should export a valid config.
Can you replace your node_modules/@bam.tech/react-native-make/react-native.config.js
file with the following and copy the output of react-native -h
:
#!/usr/bin/env node
const { resolve } = require('path');
const { lstatSync } = require('fs');
/**
* For faster development workflow, when npm linked
* we want this library to be transpiled at runtime using the ts-node resolver
*/
try {
const res = lstatSync(resolve('.', 'node_modules', '@bam.tech', 'react-native-make'));
if (res.isSymbolicLink()) {
console.warn('Detected linked install of react-native-make, compiling at runtime...');
require('ts-node').register({ project: resolve(__dirname, `tsconfig.json`) });
module.exports = require('./src/rn-plugin.config').rnPluginConfig;
} else {
const pluginConfig = require('./dist/rn-plugin.config.js').rnPluginConfig;
console.warn(pluginConfig);
module.exports = pluginConfig;
}
} catch (err) {
console.warn(err);
}
from react-native-make.
I'm getting the same issue on macOS 10.14.6, after editing node_modules/@bam.tech/react-native-make/react-native.config.js
with @yleflour 's proposed changes.
$ react-native -v
react-native-cli: 2.0.1
react-native: 0.59.8
$ node -v
v12.4.0
$ react-native -h
Commands:
start [options] starts the webserver
run-ios [options] builds your app and starts it on iOS simulator
run-android [options] builds your app and starts it on a connected Android emulator or device
new-library [options] generates a native library bridge
bundle [options] builds the javascript bundle for offline use
ram-bundle [options] builds javascript as a "Random Access Module" bundle for offline use
eject [options] Re-create the iOS and Android folders and native code
link [options] [packageName] scope link command to certain platforms (comma-separated)
unlink [options] <packageName> unlink native dependency
install [options] <packageName> install and link native dependencies
uninstall [options] <packageName> uninstall and unlink native dependencies
upgrade [options] [version] Upgrade your app's template files to the specified or latest npm version using `rn-diff-purge` project. Only valid semver versions are allowed.
log-android [options] starts adb logcat
log-ios [options] starts iOS device syslog tail
dependencies [options] lists dependencies
info [options] Get relevant version info about OS, toolchain and libraries
init [options]
from react-native-make.
Ok. First, just in case, this is the code before editing node_modules/@bam.tech/react-native-make/react-native.config.js:
#!/usr/bin/env node
const { resolve } = require('path');
const { lstatSync } = require('fs');
/**
* For faster development workflow, when npm linked
* we want this library to be transpiled at runtime using the ts-node resolver
*/
const res = lstatSync(resolve('.', 'node_modules', '@bam.tech', 'react-native-make'));
if (res.isSymbolicLink()) {
console.warn('Detected linked install of react-native-make, compiling at runtime...');
require('ts-node').register({ project: resolve(__dirname, `tsconfig.json`) });
module.exports = require('./src/rn-plugin.config').rnPluginConfig;
} else {
module.exports = require('./dist/rn-plugin.config.js').rnPluginConfig;
}
After editing:
$ react-native -h
Usage: react-native [options] [command]
Options:
--version Print CLI version
--projectRoot [string] Path to the root of the project
--reactNativePath [string] Path to React Native
--verbose Increase logging verbosity
-h, --help output usage information
Commands:
start [options] starts the webserver
run-ios [options] builds your app and starts it on iOS simulator
run-android [options] builds your app and starts it on a connected Android emulator or device
new-library [options] generates a native library bridge
bundle [options] builds the javascript bundle for offline use
ram-bundle [options] builds javascript as a "Random Access Module" bundle for offline use
eject [options] Re-create the iOS and Android folders and native code
link [options] [packageName] scope link command to certain platforms (comma-separated)
unlink [options] <packageName> unlink native dependency
install [options] <packageName> install and link native dependencies
uninstall [options] <packageName> uninstall and unlink native dependencies
upgrade [options] [version] Upgrade your app's template files to the specified or latest npm version using `rn-diff-purge` project. Only valid semver versions are allowed.
log-android [options] starts adb logcat
log-ios [options] starts iOS device syslog tail
dependencies [options] lists dependencies
info [options] Get relevant version info about OS, toolchain and libraries
init [options]
from react-native-make.
Thank you so much for taking the time to dig in.
It seems the plugin is not even loaded. This could be confirmed with a console.warn("loaded")
at the top of the file. It might be an issue on react-native-cli's part but I don't understand where it could come from.
I found out about the node ./node_modules/react-native/cli.js config
command but I expect react-native-make to not even be listed in the output on your environment...
I'm going to dig in how react-native-cli actually detects installed plugins
from react-native-make.
It works after the update, great job!
from react-native-make.
Working here too! π π₯
from react-native-make.
Guess this is officially closed π₯
from react-native-make.
Bumped in the same issue using: @yleflour
react-native-cli: 2.0.1
react-native: 0.61.0-rc.3
react-native-make 1.0.2
"devDependencies": {
"@babel/core": "^7.6.0",
"@babel/runtime": "^7.6.0",
"@bam.tech/react-native-make": "^1.0.2",
...
using macOS 10.14.6, npm 6.11.3, node 10.16.3
from react-native-make.
Also running into the same issue as @efstathiosntonas
react-native-cli: 2.0.1
react-native: 0.60.5
react-native-make 1.0.2
"devDependencies": {
"@babel/core": "7.6.0",
"@babel/runtime": "7.6.0",
"@bam.tech/react-native-make": "1.0.2",
...
Any thoughts?
from react-native-make.
Hello, @efstathiosntonas , I am unable to reproduce the issue:
What I did:
react-native init TestProject --version 0.61.0-rc.3
cd TestProject
yarn add -D @bam.tech/react-native-make
react-native -h
# Check: The "make" commands are displayed
Are you able to reproduce it on another project?
from react-native-make.
I ll check again first thing tomorrow morning and I will post back.
Iβm guessing the issue occurred because i jumped from 0.60.5 to rc3 via the upgrade tool and some packages might be messed up, Iβll delete node_modules and try again.
from react-native-make.
Hey, I used
react-native init TestProject
cd TestProject
npm i -D @bam.tech/react-native-make
and when I run react-native -h
I don't see any new option.
I'm using:
react-native-cli: 2.0.1
react-native: 0.61.0 (also tried with 0.61.0-rc.3)
@bam.tech/react-native-make: 1.0.2
Is there a way to run it out of react-native-cli?
from react-native-make.
OK, I suspected that, but thought that could not be the problem, but yes. I used yarn
instead npm
and then I see the available plugins with -h
.
I hope it helps to find the solution soon.
from react-native-make.
Thanks @yleflour for fixing it so quick. Sorry for not posting back.
from react-native-make.
Related Issues (20)
- Install error 'glib-object.h' file not found
- Generated android icons are not sharp? HOT 2
- Command in the latest version doesn't work on iOS
- black splash screen on iOS 14, iPhone 8 Plus HOT 2
- Blank black screen HOT 6
- Splash screen doesn't work on iOS HOT 2
- Question: react-native android app icons: why isn't the empty space around the image preserved? HOT 3
- How can I set notification icon?
- Android Adaptive Icons Are Incorrect HOT 1
- Splash screen not showing on iOS
- Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency HOT 2
- Push 3.0.1 to npm HOT 1
- Black splashscreen in Ios 14.4 HOT 6
- set-splash return an error "unsupported image format" about png file HOT 3
- Upgrade Sharop to 0.28.0 for compatibility fixes on M1 processors
- Splash screen feels "artificial" instead of native - blank screen still shows temporarily before splash image appears (Android)
- error: None of the input catalogs contained a matching launch image set named "LaunchImage".
- import is being duplicated in the set-splash command
- error Android project not found. HOT 2
- Android splash is skewed to the left
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-make.