Post Install Script Failing on Windows 10
Hi there, I was trying to add shoutem to my project but facing the following error on installation.
$ npm i -S @shoutem/ui
> @shoutem/[email protected] postinstall D:\Code\playground\native-react\HelloWorld\node_modules\@shoutem\ui
> react-native link
Looks like you installed react-native globally, maybe you meant react-native-cli?
To fix the issue, run:
npm uninstall -g react-native
npm install -g react-native-cli
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-S" "@shoutem/ui"
npm ERR! node v6.8.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! @shoutem/[email protected] postinstall: `react-native link`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @shoutem/[email protected] postinstall script 'react-native link'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @shoutem/ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-native link
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs @shoutem/ui
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls @shoutem/ui
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\Code\playground\native-react\HelloWorld\npm-debug.log
Now the error tells me that I have:
Looks like you installed react-native globally, maybe you meant react-native-cli?
To fix the issue, run:
npm uninstall -g react-native
npm install -g react-native-cli
I have repeated the above suggested steps a couple of times, but the installation keeps throwing the same error, every time.
I found a comment on github asking me to add react-native-cli to devDependencies
https://github.com/facebook/react-native/issues/4515#issuecomment-161726473
With that I get a different error altogether:
$ npm i -S @shoutem/ui
> @shoutem/[email protected] postinstall D:\Code\playground\native-react\HelloWorld\node_modules\@shoutem\ui
> react-native link
Command `link` unrecognized. Did you mean to run this inside a react-native project?
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-S" "@shoutem/ui"
npm ERR! node v6.8.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! @shoutem/[email protected] postinstall: `react-native link`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @shoutem/[email protected] postinstall script 'react-native link'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @shoutem/ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-native link
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs @shoutem/ui
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls @shoutem/ui
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\Code\playground\native-react\HelloWorld\npm-debug.log
This is a known issue for windows users and shoutem is actively working on it.
In the meantime, you could probably avoid this bug in the Shoutem UI by running:
npm install --ignore-scripts
npm install react-native
react-native link
instead of just
npm install
Got the same issue as well. Just seems to be executing 'react-native link' on the wrong directory.
Should happen in the main directory of the react-native project rather than at ./node_modules/@shoutem/ui.
Thanks @ikatun it seems to be working with your suggestion.
Duplicate, solution here as well:
https://github.com/shoutem/ui/issues/62#issuecomment-252706778
I have the same issue on Mac OS with node 7 (everything is uptodate).
This stuff should be simple. If it's too hard, even at installation, no one should use it.