Menu icon Foundation
F6.2.0 Failed to load babel-register

I just made a new project to try out the new version but when I type NPM Start I get an error that it failed to load external module babel-register. Error message below. Any ideas on what the problem is would be appreciated.

Thanks
Barbara

D:\Sites\F_620a>npm start

> [email protected] start D:\Sites\F_620a
> gulp

[18:00:48] Failed to load external module babel-register
[18:00:48] Requiring external module babel-core/register
D:\Sites\F_620a\node_modules\babel-core\lib\transformation\file\options\option-m
anager.js:206
throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i,
dirname));
^

ReferenceError: Unknown plugin "transform-es2015-arrow-functions" specified in "
D:\\Sites\\F_620a\\.babelrc" at 0, attempted to resolve relative to "D:\\Sites\\
F_620a"
at D:\Sites\F_620a\node_modules\babel-core\lib\transformation\file\options\o
ption-manager.js:206:17
at Array.map (native)
at Function.normalisePlugins (D:\Sites\F_620a\node_modules\babel-core\lib\tr
ansformation\file\options\option-manager.js:182:20)
at OptionManager.mergeOptions (D:\Sites\F_620a\node_modules\babel-core\lib\t
ransformation\file\options\option-manager.js:298:36)
at OptionManager.addConfig (D:\Sites\F_620a\node_modules\babel-core\lib\tran
sformation\file\options\option-manager.js:234:10)
at OptionManager.findConfigs (D:\Sites\F_620a\node_modules\babel-core\lib\tr
ansformation\file\options\option-manager.js:434:16)
at OptionManager.init (D:\Sites\F_620a\node_modules\babel-core\lib\transform
ation\file\options\option-manager.js:482:12)
at compile (D:\Sites\F_620a\node_modules\babel-core\node_modules\babel-regis
ter\lib\node.js:83:45)
at loader (D:\Sites\F_620a\node_modules\babel-core\node_modules\babel-regist
er\lib\node.js:128:14)
at Object.require.extensions.(anonymous function) [as .js] (D:\Sites\F_620a\
node_modules\babel-core\node_modules\babel-register\lib\node.js:138:7)

F6Babel

I just made a new project to try out the new version but when I type NPM Start I get an error that it failed to load external module babel-register. Error message below. Any ideas on what the problem is would be appreciated.

Thanks
Barbara

D:\Sites\F_620a>npm start

> [email protected] start D:\Sites\F_620a
> gulp

[18:00:48] Failed to load external module babel-register
[18:00:48] Requiring external module babel-core/register
D:\Sites\F_620a\node_modules\babel-core\lib\transformation\file\options\option-m
anager.js:206
throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i,
dirname));
^

ReferenceError: Unknown plugin "transform-es2015-arrow-functions" specified in "
D:\\Sites\\F_620a\\.babelrc" at 0, attempted to resolve relative to "D:\\Sites\\
F_620a"
at D:\Sites\F_620a\node_modules\babel-core\lib\transformation\file\options\o
ption-manager.js:206:17
at Array.map (native)
at Function.normalisePlugins (D:\Sites\F_620a\node_modules\babel-core\lib\tr
ansformation\file\options\option-manager.js:182:20)
at OptionManager.mergeOptions (D:\Sites\F_620a\node_modules\babel-core\lib\t
ransformation\file\options\option-manager.js:298:36)
at OptionManager.addConfig (D:\Sites\F_620a\node_modules\babel-core\lib\tran
sformation\file\options\option-manager.js:234:10)
at OptionManager.findConfigs (D:\Sites\F_620a\node_modules\babel-core\lib\tr
ansformation\file\options\option-manager.js:434:16)
at OptionManager.init (D:\Sites\F_620a\node_modules\babel-core\lib\transform
ation\file\options\option-manager.js:482:12)
at compile (D:\Sites\F_620a\node_modules\babel-core\node_modules\babel-regis
ter\lib\node.js:83:45)
at loader (D:\Sites\F_620a\node_modules\babel-core\node_modules\babel-regist
er\lib\node.js:128:14)
at Object.require.extensions.(anonymous function) [as .js] (D:\Sites\F_620a\
node_modules\babel-core\node_modules\babel-register\lib\node.js:138:7)

John Vedral over 3 years ago

I had the same exact problem running foundation sites from the command line on Linux Mint. In addition, it could not find the babel plugins for es2015. My solution was to install the missing modules manually using

npm install babel-register babel-plugin-transform-es2015-arrow-functions babel-plugin-transform-es2015-block-scoped-functions babel-plugin-transform-es2015-block-scoping babel-plugin-transform-es2015-classes babel-plugin-transform-es2015-destructuring babel-plugin-transform-es2015-template-literals babel-plugin-transform-es2015-parameters babel-plugin-transform-es2015-shorthand-properties babel-plugin-transform-es2015-spread babel-plugin-transform-es2015-modules-commonjs

I am investigating the issue further to see why the modules are not found. As far as I can tell, they are installed in subdirectories which may not be detected by the existing code. Loading them manually installs them in the top level node_modules directory.

John Vedral over 3 years ago

The following code will accomplish the same thing as my previous reply.

npm install babel-register babel-preset-es2015 

Sven CAILTEUX over 3 years ago

John

npm install babel-register babel-preset-es2015

didn't work for me, same issue, so I've tried previous command and now it works

John Vedral over 3 years ago

The link for upgrading to 6.2 does contain some of the information, however, the issue exists with brand new projects using the foundation zurb template for sites.
Probably the template needs to be updated with the required changes so that new projects don't have the additional manual steps.
I will investigate the code on github and see if it is something I feel comfortable submitting as a pull request.

Mark Hair over 3 years ago

I also had a problem with npm install gulp-babel babel-preset-es2015 --save-dev and it told me I needed to launch terminal as an administrator....which is kind of strange since my user account is such. However, when I did "run as administrator" with powershell (in Windows 7), then I had success.

Arkarys over 3 years ago

Gulp-babel and babel-preset-es2015 are definitely missing in new site and mail projects.
"Failed to load external module babel-register"

npm install gulp-babel babel-preset-es2015 --save-dev
from the Upgrading to Foundation 6.2 page does the trick.

Foundation CLI version 2.1.0 under Windows 7,
Node 5.5.0, npm 3.3.12,
foundation-sites 6.2.0, foundation-emails 2.0.0, foundation-apps-template 1.2.0

And don't use weird characters in directory names. I despaired, until I realized it was an exclamation mark.

 

 

Nick Roper over 3 years ago

I also had problems until I ran:

$ npm install babel-register babel-preset-es2015

Works OK now

Shouldn't this be baked into the latest version?

 

 

Matt Bryant almost 3 years ago

I'm having the same issue with babel.

 

I'm spun up a new Foundation Template project using the Foundation CLT. When I initiate "foundation watch/build" in the CLI, I get this message: Requiring external module babel-register and my javascript files are not compiling to the dist folder.

 

I've installed Babel via cli using 

$ npm install babel-register babel-preset-es2015

 

I can see that it is installed in my .npm folder along with all of my other node packages. After testing again and getting the same message, I checked the .babelrc file that came with the Foundation template. It initially read:

{
	"presets": ["es2015"],
  "compact": false
}

 

So, I updated it to read : true according to the 6.2 upgrade directions, but I'm getting the same error and the js still isn't compiling. 

 

Does anyone have a notion what I might be doing wrong here?

Michiel Sweere almost 3 years ago

+1 for Matt Bryant (exactly the same problem).

Michiel Sweere almost 3 years ago

I've tried some more variations:

- Installed babel-register and babel-preset-es2015 both local and global

- Cloning the GIT repo for foundation-sites (instead of using the command 'foundation new')

- Checking all the information in the "Upgrading to 2.0" page

- Tried the 'long' command (locally) as stated by John Vedral earlier in this thread

And some permutations of the options above.

 

However: I keep getting the message "Requiring external module babel-register"; which slows the process down quite a lot.

Versions:
npm -v: 2.7.4
gulp -v: CLI version 1.2.2., Local version 4.0.0-alpha.2
foundation -v: CLI version 2.1.
node -v: v0.12.2

Any help is greatly appreciated!

 

Mike Cordeiro almost 3 years ago

I'm having a similar issue.

I'll start a new Foundation Email's project and everything will work well, then when I return to the project a few days later and run npm start, I get the babel errors.

[13:45:08] Failed to load external module babel-register
[13:45:08] Failed to load external module babel-core/register
[13:45:08] Failed to load external module babel/register

The specific errors I've seen are in this thread. Creating a new project and moving my files will solve the problem, but it regularly comes back.

Geoffroy almost 2 years ago

Still have this issue ... I followed this comment: https://foundation.zurb.com/forum/posts/38635-f620-failed-to-load-babel-register#comment_35771

And the official wiki of Foundation 6.2: https://github.com/zurb/foundation-sites/wiki/Upgrading-to-Foundation-6.2

But on the point 3 of Javascript:

  1. In gulpfile.js, add the Babel plugin to your javascript task, right above the $.concat()step:

I didn't understand which gulpfile.js it is refering....

 

If I add the gulp task on the `gulpfile.babel.js` doesn't work :(

 

Any idea?

Christopher Zavatchen almost 2 years ago

I am also seeing the following message that slows down the reading of the "gulpfile.babel.js" in my new project I created using the "foundation new" command:

[19:57:56] Failed to load external module @babel/register
[19:57:56] Requiring external module babel-register

I have the following installed for reference:

  • Foundation CLI 2.2.5
  • Node.js 6.12.2
  • npm 5.6.0
  • Foundation for Sites 6.4.3
  • gulp CLI 1.4.0
  • gulp Local 4.0.0-alpha.2 (This came with Foundation via the "foundation new" command.)

I tried some of the ideas mentioned above, but none of them corrected the problem.

My development site and environment still loads and works properly, but when I type "foundation watch" the "Requiring external module babel-register" line causes me to have to wait a few minutes before I can start working on the project.

I did some searching online and found the following that talks about the problem and it sounds like it might be normal to see this error:

It would be helpful if someone could let us know if it is normal for the error to appear or if it is something that is being fixed in a newer version of Zurb Foundation. For now I am going to live with the message and delay and hope it is fixed in the future.