This script aims to automate the process of initializing a React App using the Wolox standards.
To run from server:
You don't need to clone this repository. Just follow these steps:
Run the installation script using the following command:
bash <(curl -s https://raw.githubusercontent.com/Wolox/react-bootstrap/development/run.sh)
Optional parameters:
-v
or--verbose
: Display more information as the bootstrap is running-l
or--local
: Run a local version of the bootstrap
To setup a local version of the bootstrap, you may clone it and do the following:
cd ./react-bootstrap
npm link
After that, every time you want to run it you may execute the run script: with the local flag
# Make sure you are in the parent folder of the bootstrap
./react-bootstrap/run.sh -l
This script will configure your system to install global npm packages without having to use sudo.
Sometimes when running the generator, you will get an error indicating that yeoman
is not installed and a prompt with a message like: -bash: yo: command not found
. We've found that this is sometimes caused by not having the node modules binaries route correctly configured.
The easiest way to fix it is by adding this line to the end of your ~/.bashrc
, ~/.zshrc
or the configuration script for your shell:
export PATH=/usr/local/share/npm/bin:$PATH
If the above does not work, another possible way to fix it is the following:
- Uninstall
yeoman
:sudo npm remove -g yo
- Manually set your node path:
sudo npm config set prefix $NVM_DIR/versions/node/$(node--version)
- export the
NODE_PATH
variable:export NODE_PATH=$NVM_DIR/versions/node/$(node --version)/lib/node_modules
- Reinstall it:
npm install -g yo
WARNING: If you accidentaly save wrong paths here you might break npm/node. If you do, try to set the prefix again, manually inserting your node version. If doesn't work you may need to uninstall node and npm, reinstall them and start over.