When launching react-native upgrade with the last version (0.31), it stops immediately with this error:
rnpm-upgrade ERR! ERRPACKAGEJSON No package found. Are you sure it's a React Native project?
config.getProjectConfig is not a function
We tried with different node versions but always have this error.
Anyone has an idea? cc @grabbou
Maybe the internalisation of rnpm ? cc @grabbou
Edit:
When I do a react-native --help I got the upgrade option two times:
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
unbundle [options] builds javascript as "unbundle" for offline use
link [packageName] links all native dependencies
unlink <packageName> unlink native dependency
install <packageName> install and link native dependencies
uninstall <packageName> uninstall and unlink native dependencies
upgrade upgrade your app's template files to the latest version; run this after updating the react-native version in your package.json and running npm install
log-android starts adb logcat
log-ios starts iOS device syslog tail
upgrade Upgrade your React Native project
I try to look in the code, and I just can find the first one but not the last
@magrinj: You must have rnpm-plugin-upgrade as a dev dependency. Since rnpm has been merged into react-native, you should just be able to use react-native upgrade instead of rnpm upgrade.
@rozele Thanks for your answer, but I already have rnpm-plugin-upgrade as a dev dependency, and I use the react-native upgrade command.
cc @Kureev
how about merging rnpm-plugin-upgrade to RN core? It'll enable us to remove the yeoman dependency altogether.
same error.
I'll try to hack it on the weekend if I have a time
I had the same problem but I solved it:
rnpm-plugin-upgrade dev dependency in package.jsonnode_modules with npm prunereact-native upgrade works fine :)@oziks Fine!!!Thx
Thanks @oziks, for those who have an error like Can't find rnpm-plugin-upgrade after doing @oziks instruction, juste remove your node_modules folder and run an npm i (npm prune doesn't solve the problem for me). Don't forget to remove rnpm-plugin-upgrade in your dev dependency before that.
@oziks Thanks!
I solved it just tow steps:
1.remove rnpm-plugin-upgrade dev dependency in package.json
2.run react-native upgrade
Most helpful comment
I had the same problem but I solved it:
rnpm-plugin-upgradedev dependency inpackage.jsonnode_moduleswithnpm prunereact-native upgradeworks fine :)