Skip to content
This repository has been archived by the owner on Jun 16, 2019. It is now read-only.

babel-node not recognized as internal or external command #30

Open
imsam67 opened this issue Oct 24, 2016 · 76 comments
Open

babel-node not recognized as internal or external command #30

imsam67 opened this issue Oct 24, 2016 · 76 comments

Comments

@imsam67
Copy link

imsam67 commented Oct 24, 2016

I'm following along the tutorial on PluralSight for React with ES6 and Redux. I'm using Visual Studio Code as my editoe. When I add babel-node in the start script, I get

babel-node not recognized as internal or external command

Any idea why?

@coryhouse
Copy link
Owner

Have you run npm install? What version of node and npm are your running? What OS?

@imsam67
Copy link
Author

imsam67 commented Oct 24, 2016

Yes, I have run npm install
I'm running node version 6.3.1 and npm 3.10.9. I'm running this on a Windows 10 machine build 14393.321

I got all this information using the built-in terminal in Visual Studio Code from inside the project folder -- except Windows 10 build.

Also if I run npm list babel-node from the terminal, I get (empty) so it doesn't seem to be installed. By the way, babel-node is not in package.json either.

@coryhouse
Copy link
Owner

Like you, npm list babel-node returns nothing for me, but it works because it's bundled with babel.

If you look in node_modules/.bin, you should see a babel-node folder. Do you?

@pddigital
Copy link

Same problem for me with Windows 10...
No babel-node is installed.
Nothing under .bin.

@imsam67
Copy link
Author

imsam67 commented Oct 24, 2016

There is no babel-node folder inside "node_modules" or "node_modules/.bin"

I'm attaching a screen shot of the .bin folder under node_modules

node_modules_screen_shot

@pddigital
Copy link

Ditto for me. No babel-node in the bin directory. I sort of got it to work by installing babel-cli globally but now it doesn't recognize anything in the package.json, so that's not a fix.

@coryhouse
Copy link
Owner

That's bizarre. I've just tried it in the terminal in the latest version of Visual Studio Code and on the native terminal in Windows 10. It works just fine in both.

Are you all using the project completely unchanged? I simply cloned this repo on Windows 10 and it worked. I'm using Node 6.3 as well.

@imsam67
Copy link
Author

imsam67 commented Oct 24, 2016

I didn't clone the project. I'm creating the files/folders as I go through the PluralSight video. The only difference is that instead of using WebStorm, I'm using Visual Studio Code.

@pddigital
Copy link

node v6.5, npm v3.10.3, Atom... Windows 10. I just deleted and recloned the directory, npm installed, npm started, same deal.

@pddigital
Copy link

I downgraded node to 5.14 and it works! Thanks. That was actually in the readme. Windows has a problem with Node 6.

@coryhouse
Copy link
Owner

Good to hear you're rolling Paul. The frustrating thing is Node 6 works fine on some Windows machines. I'd like to figure out why some Windows machines are failing, but I haven't been able to reproduce on any of my Windows boxes.

@coryhouse
Copy link
Owner

@imsam67 Have you tried running Node 5 instead? That has resolved the issue for some others on Windows.

@imsam67
Copy link
Author

imsam67 commented Oct 24, 2016

It didn't work for me. See the image below
capture

I don't know how Paul was able to go down to 5.14. I don't see that version even listed here:
https://nodejs.org/en/download/releases/

@imsam67
Copy link
Author

imsam67 commented Oct 24, 2016

Interestingly, if I download the whole project from GitHub and run npm install, I do end up with babel-node in .bin and npm start -s works fine

Not sure why when I was simply following the video and created things step by step, it didn't work. Possibly skipping something unintentionally

@coryhouse
Copy link
Owner

Interesting. I recommend avoiding paths with a space. Also, if downloading this project from github works fine, then I'd be interested to know what's different with your hand built version. Did you perform a diff? Alternatively, can you post it on Github?

@imsam67
Copy link
Author

imsam67 commented Oct 26, 2016

Sorry about the late response. I tried to figure out what's causing the issue but couldn't. Here's the repo for what I have in my project folder.
https://github.com/imsam67/reactredux

@coryhouse
Copy link
Owner

@imsam67 I just cloned your project and it fails on npm start because you haven't created testSetup.js, which is being called by the start script.

@imsam67
Copy link
Author

imsam67 commented Oct 27, 2016

Cory, thanks for trying to figure this out. You're right that I had not created the testSetup.js file. Though I just added it, still getting the same error.
capture

For some reason, the babel-node is not being installed. I even copied and pasted both package.json and webpack.config.dev.js directly from the repo but still getting the same error.

@coryhouse
Copy link
Owner

Very strange. I can't reproduce. Can you show me what's in your node_modules?

@psantos9
Copy link

psantos9 commented Nov 2, 2016

Try the following: npm install -g babel-cli

@coryhouse
Copy link
Owner

@imsam67 - Can you show me what's in your node_modules folder? A screenshot of the folders that fit on screen would suffice.

@imsam67
Copy link
Author

imsam67 commented Nov 11, 2016

Here's what fits on screen
capture

@coryhouse
Copy link
Owner

That screenshot looks good. And if you see babel-node in node_modules/.bin then you should be working fine now.

@chookie
Copy link

chookie commented Nov 13, 2016

I am not sure if you have the same issue but I was getting the same problem until I realised I had saved my .babelrc file under src instead of the project root at the same level as package.json. I must have had src as the active folder when I saved.

As a side note, I used Intellij a lot in the past but now I have been using Atom before where it is more obvious where you are saving I find Webstorm a little clunky in file manipulation and editing compared to Atom/Sublime et. al. @coryhouse do you have any suggestions on how to make Webstorm more like Atom or Sublime for editing?

@chookie
Copy link

chookie commented Nov 13, 2016

Oh and as another tip, you can see if babel-node is working but adding another script in your package.json

  "scripts": {
    "start": "babel-node tools/srcServer.js",
    "babel-node-version": "babel-node --version"
  },

then run
npm run babel-node-version
then see the version 6.8.0

@daveleigh22
Copy link

daveleigh22 commented Nov 14, 2016

Hi all, same issue, windows 10, following on pluralsight and just setting up the project. I have managed to resolve but i did this by reinstalling every version of babel i could.. babel-cli, babel-node etc and eventually it worked..

@coryhouse
Copy link
Owner

One other thing to try for anyone who gets bit by this: Delete node_modules and reinstall.

@xenoxsis
Copy link

@coryhouse I tried to delete node_modules like you said. No change.

'babel-node' is not recognized as an internal or external command, operable program or batch file.

Do you have any other ideas? I copied srcServer.js, package.json, webpack.config.dev.js and .babelrc directly from the github.

@coryhouse
Copy link
Owner

@spettifer
Copy link

As per BaReinhard above, I also had to upgrade nodejs 7.x.x to 8.1.2 (which upgraded npm to 5.4.0 too) and that fixed the problem for me. I had assumed that since I was on node > 6 I wouldn't have a problem, but it turned out that was an incorrect assumption. Wasted a good couple of hours trying to sort that out which is frustrating as the course is very good so far!

@coryhouse
Copy link
Owner

Hi @spettifer - Sorry to hear that - What issue were you seeing before you upgraded Node?

@spettifer
Copy link

spettifer commented Jul 27, 2017

Hi @coryhouse, thanks for the reply!

It was very odd. The output of npm start was this:

C:_git\React\react-redux-intro>npm start
[email protected] start C:_git\React\react-redux-intro
babel-node tools/srcServer.js

C:_git\React\react-redux-intro\node_modules\webpack-dev-middleware\middleware.js:106
if(err) throw err;
^
Error
at pathToArray (C:_git\React\react-redux-intro\node_modules\memory-fs\lib\MemoryFileSystem.js:44:10)
at MemoryFileSystem.mkdirpSync (C:_git\React\react-redux-intro\node_modules\memory-fs\lib\MemoryFileSystem.js:139:13)
at MemoryFileSystem.(anonymous function) [as mkdirp] (C:_git\React\react-redux-intro\node_modules\memory-fs\lib\MemoryFileSystem.js:279:34)
at Compiler. (C:_git\React\react-redux-intro\node_modules\webpack\lib\Compiler.js:229:25)
at Compiler.applyPluginsAsync (C:_git\React\react-redux-intro\node_modules\tapable\lib\Tapable.js:60:69)
at Compiler.emitAssets (C:_git\React\react-redux-intro\node_modules\webpack\lib\Compiler.js:226:7)
at Watching. (C:_git\React\react-redux-intro\node_modules\webpack\lib\Compiler.js:54:18)
at C:_git\React\react-redux-intro\node_modules\webpack\lib\Compiler.js:403:12
at Compiler.next (C:_git\React\react-redux-intro\node_modules\tapable\lib\Tapable.js:67:11)
at Compiler. (C:_git\React\react-redux-intro\node_modules\webpack\lib\CachePlugin.js:40:4)

npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program > Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v7.0.0
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: babel-node tools/srcServer.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'babel-node tools/srcServer.js'.
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 pluralsight-redux-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! babel-node tools/srcServer.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pluralsight-redux-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pluralsight-redux-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:_git\React\react-redux-intro\npm-debug.log`

And the npm-debug.log file didn't really add any more info than that. I tried messing about with babel-node, I deleted node_modules and did a cache clean and reinstall all to no avail. I also tried with verbose output from npm start, but that didn't reveal much either (at least not to me - maybe someone with more experience would see something I can't).

It was sheer desperation that made me try upgrading from node 7 to node 8 (which brings npm 5.4.0 with it) and suddenly it burst into life. I have no idea why. The most curious thing was that if I cloned your repo it worked perfectly well, even with the scripts section pared down to just the start script (which is where I was in the course). I can only assume it was some quick of npm but quite why it worked on the cloned repo but not the project I was building up from scratch is a mystery.

@timratha
Copy link

timratha commented Aug 7, 2017

@mohamed-ismat : Thanks for your useful tip ;)

@StephaneHo
Copy link

Hi,

I launched npm install from the cmd windows instead of the atom command line and it solved the problem

@vicneanschi
Copy link

Run npm install --save-dev babel-cli

@caleriggs
Copy link

I reinstalled node, ran npm install again, and it added a bunch more babel folders in the node directory, and afterward I was able to run it just fine. After having similar problems to everyone else.

@prudhvinani
Copy link

Hello @coryhouse I start following your tutorials in pluralsigth when I try to run npm run it gives me following error I am using windows7 , Webstrom

C:\Users\User\WebstormProjects\React>npm start

[email protected] start C:\Users\User\WebstormProjects\React
bable-node tools/srcServer.js

'bable-node' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: bable-node tools/srcServer.js

npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2017-10-05T04_40_07_1
45Z-debug.log

C:\Users\User\WebstormProjects\React>node -v
v8.1.4

C:\Users\User\WebstormProjects\React>npm -v
5.4.2

@coryhouse
Copy link
Owner

@prudhvinani - Looks like you have a typo. bable-node should be babel-node

@prudhvinani
Copy link

oops thanks@coryhouse

@alernerdev
Copy link

Had the same babel problem as the rest of Windows 10 folks. I am using Node 8.9.1. Tried reinstalling everything outside of VSCode environment, tried deleting node_modules, etc. Finally, replacing "latest" with "env" in .babelrc fixed it. Thanks to @ppremk user.

@ppremk
Copy link

ppremk commented Dec 4, 2017

@alernerdev glad it worked for you! 👍

@konradhanus
Copy link

resolved problem :)
npm install -g babel-cli

@ngankt2
Copy link

ngankt2 commented Apr 17, 2018

if node_modules/.bin/babel-node not found
=>
npm i --save-dev babel-cli OR npm i -g babel-cli
=>
it's working!

if in window os:
"dev": "cross-env NODE_ENV=development nodemon node_modules\\babel-cli\\bin\\babel-node.js ./bin/www",
=> it's worked!

p/s: in my mac os is:
"start": "cross-env DEBUG=connect:* NODE_ENV=development nodemon node_modules/.bin/babel-node ./bin/www",

@avprod1
Copy link

avprod1 commented Apr 22, 2018

Hi @coryhouse

I'm on WIN10, using WebStorms 30-d trial.
I am in Environment Setup, create Start Script.

Here is the message when I run npm start -s

c:\reduxStarter\pluralsight-redux-starter>npm start -s
'bable-node' is not recognized as an internal or external command,
operable program or batch file.

I have uninstalled all nodejs, installed nvm, installed node v5.12.0, v6.1.0, v8.11.1.
I have tried in both 5.12.0 as well as 8.11.1.
I have removed node_modules, re-run npm install.
I have tried installing babel-cli@latest manually the main install.
set NODE_ENV returns "not defined"

node -v = 8.11.1. npm - v = 5.6.0
Here is my repository to see where I'm at:
https://github.com/avprod1/pluralsight-redux-starter

Thank you for your assistance. --Scott--

@coryhouse
Copy link
Owner

@avprod1 - I just replied on your repo via an issue. You had a typo. It should say babel-node in start.

@avprod1
Copy link

avprod1 commented Apr 24, 2018 via email

@avprod1
Copy link

avprod1 commented May 2, 2018 via email

@coryhouse
Copy link
Owner

@avprod1 - Please don't reply here since your request is unrelated to this issue. Can you please post this on the course discussion board instead? That's where I handle course related questions so others can easily find answers if they're stuck in similar ways.

@mazinbabo
Copy link

mazinbabo commented May 28, 2018

@coryhouse I am getting the same issue in window 10 with node v8.11.1

npm start

[email protected] start D:\react-redux\demo
babel-node tools/srcServer.js

module.js:549
throw err;
^

Error: Cannot find module 'D:\react-redux\demo\tools\srcServer.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at D:\react-redux\demo\node_modules\babel-cli\lib_babel-node.js:171:48
at Object. (D:\react-redux\demo\node_modules\babel-cli\lib_babel-node.js:172:7)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: babel-node tools/srcServer.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mazin\AppData\Roaming\npm-cache_logs\2018-05-28T23_23_55_582Z-debug.log

i think there is something messing

@coryhouse
Copy link
Owner

@mazinbabo -

  1. What command line are you using? I suggest using the plain Windows command line to see if that helps.
  2. Have you tried npm install -g babel-cli?
  3. Ensure you do not have NODE_ENV=production in your env variables. If you do then dev dependencies won't be installed.

@mazinbabo
Copy link

@coryhouse I clone starter-kit and when i run it it works fine . I was following the setup from the course and I thing i was messing something

@coryhouse
Copy link
Owner

@mazinbabo - Great to hear you're running now! Would you be willing to put your course project on GitHub so I can understand what typo you might have made to cause this issue?

@RDC07
Copy link

RDC07 commented Jul 7, 2018

I had similar issue 'babel-node' is not recognized as an internal.........
@mohamed-ismat trick worked form me.

@ymulenll
Copy link

ymulenll commented Aug 2, 2018

Just delete node_modules folder and try again:
npm install
npm start

That worked for me!

@natovichat
Copy link

I run npm install from Atom terminal and got
"babel-node not recognized as internal or external command"
when i run npm install from my windows command line , everything start to work!

@UmairQureshi1
Copy link

UmairQureshi1 commented Sep 10, 2018

npm start or npm start -s
"babel-node not recognized as internal or external command"
when i run npm install from my windows command line
then no reply. just move next line on app folder .../my-app>
just like bellow
C:\Users\DELL_Home\forReact\nodejs\my-app>npm start

[email protected] start C:\Users\DELL_Home\forReact\nodejs\my-app
babel-node tools/srcServer.js

C:\Users\DELL_Home\forReact\nodejs\my-app>npm start -s

C:\Users\DELL_Home\forReact\nodejs\my-app>

@RamyasreeSiri
Copy link

Worked for me after installing @babel/node, my node version is 8.11.3

try to install @babel/node instead of @babel/cli:
yarn add @babel/node or npm install --save-dev @babel/node

and then you could use it according to the README:

babel-node [options] [ -e script | script.js ] [arguments]

@atuljssate
Copy link

@xenoxsis - Have you checked this list? https://github.com/coryhouse/pluralsight-redux-starter#having-issues-try-these-things-first

Delete node_modules and reinstall worked for me!

Thank you Cory

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests