Closed joeeames closed 8 years ago
Hi,
I am not sure this is needed since babel-node
is currently specified in package.json
.
After running npm install
, you shouldn't need anything more to run the examples. Did you had trouble with what was installed by npm install
(wasn't it enough to run npm run example <example.js>
)?
No. Babel-node must be installed globally otherwise the command fails because it's not in the global path.
This was true on my box and as far as I know true always. Any command besides "node" from the cli would require a global install or else a reference into the path in node_modules....
I'm on holiday and not where I can do much testing or research. Can you run it on a box with no Babel cli installed globally? I couldn't.
On Fri, Oct 30, 2015, 6:52 PM François Bonnefont notifications@github.com wrote:
Hi,
I am not sure this is needed since babel-node is currently specified in package.json.
After running npm install, you shouldn't need anything more to run the examples. Did you had trouble with what was installed by npm install (wasn't it enough to run npm run example
)? — Reply to this email directly or view it on GitHub https://github.com/happypoulp/redux-tutorial/pull/58#issuecomment-152615671 .
Isn't this why projects that use gulp remind you to install it globally?
On Wed, Nov 4, 2015, 12:37 PM Joe Eames joeeames@gmail.com wrote:
No. Babel-node must be installed globally otherwise the command fails because it's not in the global path.
This was true on my box and as far as I know true always. Any command besides "node" from the cli would require a global install or else a reference into the path in node_modules....
I'm on holiday and not where I can do much testing or research. Can you run it on a box with no Babel cli installed globally? I couldn't.
On Fri, Oct 30, 2015, 6:52 PM François Bonnefont notifications@github.com wrote:
Hi,
I am not sure this is needed since babel-node is currently specified in package.json.
After running npm install, you shouldn't need anything more to run the examples. Did you had trouble with what was installed by npm install (wasn't it enough to run npm run example
)? — Reply to this email directly or view it on GitHub https://github.com/happypoulp/redux-tutorial/pull/58#issuecomment-152615671 .
No. Babel-node must be installed globally otherwise the command fails because it's not in the global path.
On my environment, I did not installed babel-node globally and npm run example <example.js>
is running correctly.
This was true on my box and as far as I know true always. Any command besides "node" from the cli would require a global install or else a reference into the path in node_modules....
When you run a command through npm run
, npm automatically search for executable located inside node_module/.bin
. Since babel-node is installed via the package.json
, it is present in node_module/.bin
.
See: https://docs.npmjs.com/cli/run-script In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. Any binaries provided by locally-installed dependencies can be used without the node_modules/.bin prefix
Isn't this why projects that use gulp remind you to install it globally?
I can't say, I don't know much of gulp :).
I'd really like to avoid forcing anyone to install babel-node globally for the tutorial if it's not strictly required. When you will be able to, please confirm that you can run the examples without a globally installed babel-node.
Thanks!
I can confirm that you are correct, it runs just fine without babel-node installed globally on my computer.
I now realize what I did. I had not followed all instructions, and was trying to diagnose why something wasn't working, and tried babel-node manually from the CLI. I was unaware of this feature of npm run.
You can reject this PR. Sorry for the trouble. Excellent tutorial btw.
On Wed, Nov 4, 2015 at 6:35 PM, François Bonnefont <notifications@github.com
wrote:
No. Babel-node must be installed globally otherwise the command fails because it's not in the global path.
On my environment, I did not installed babel-node globally and npm run example
is running correctly. This was true on my box and as far as I know true always. Any command besides "node" from the cli would require a global install or else a reference into the path in node_modules....
When you run a command through npm run, npm automatically search for executable located inside node_module/.bin. Since babel-node is installed via the package.json, it is present in node_module/.bin.
See: https://docs.npmjs.com/cli/run-script
- In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. Any binaries provided by locally-installed dependencies can be used without the node_modules/.bin prefix *
Isn't this why projects that use gulp remind you to install it globally?
I can't say, I don't know much of gulp :).
I'd really like to avoid forcing anyone to install babel-node globally for the tutorial if it's not strictly required. When you will be able to, please confirm that you can run the examples without a globally installed babel-node.
Thanks!
— Reply to this email directly or view it on GitHub https://github.com/happypoulp/redux-tutorial/pull/58#issuecomment-153822929 .
Joe Eames Software Craftsman
closed because this is unnecessary.
In case someone running the tutorial hasn't yet installed babel-cli.