How to resolve the issue with you install babel?

It all started with ineficacia js files through gulp-uglify. I use es6, and it gives the following error
GulpUglifyError: unable to minify JavaScript
Caused by: SyntaxError: Unexpected token: name (container)
File: /var/www/test.loc/build/assets/js/main.js

I mean, I initialized the variable via let.

Found the solution where indicated to install gulp-babel before gulp-uglify, here in js gulpfile.js

gulp.task("js:build", function(){
gulp.src(path.src.js)
.pipe(sourcemaps.init())
.pipe(plumber())
.pipe(rigger())
.pipe(gulp.dest(path.build.js))
.pipe(uglify())
.pipe(removeComments())
.pipe(rename("main.min.js"))
.pipe(sourcemaps.write())
.pipe(gulp.dest(path.build.js))
.pipe(browserSync.stream());
});


Trying to install gulp-babel and get the following error
sudo npm install --save-dev gulp-babel babel-preset-env
npm WARN gulp-babel@7.0.0 requires a peer of babel-core@6 || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc but none is installed. You must install peer dependencies yourself.

npm ERR! Cannot read property '0' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR! /home/serii/.npm/_logs/2017-12-09T19_05_31_098Z-debug.log


I do not understand what to install. Already tired with this problem. Waiting for the kick to go on.
Thanks in advance.
June 10th 19 at 16:31
1 answer
June 10th 19 at 16:33
judging from the gulpfile, babel is not used
I'm just trying to install gulp-file from the npm website and get the error
sudo npm install --save-dev gulp-babel babel-preset-env
npm WARN gulp-babel@7.0.0 requires a peer of babel-core@6 || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc but none is installed. You must install peer dependencies yourself.

npm ERR! Cannot read property '0' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR! /home/serii/.npm/_logs/2017-12-09T19_28_47_984Z-debug.log


If all are installed, I'm going to give gulp-babel in gulpfile.js but while I struggle with mistakes. - Luigi_K commented on June 10th 19 at 16:36
and so you just have to read the error.
but none is installed. You must install peer dependencies yourself.

it is only necessary to place the babel-core - timmothy.Tromp43 commented on June 10th 19 at 16:39
I understand English, just errors piled one after the other
sudo npm i babel-core
npm ERR! Cannot read property '0' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR! /home/serii/.npm/_logs/2017-12-09T19_32_37_542Z-debug.log
- Luigi_K commented on June 10th 19 at 16:42
what version of node? - leonor36 commented on June 10th 19 at 16:45
, updated npm, node v9.2.0 - Luigi_K commented on June 10th 19 at 16:48
Here is the error
Unable to save binary /var/www/test.loc/node_modules/node-sass/vendor/linux-x64-59 : { Error: EACCES: permission denied mkdir '/var/www/test.loc/node_modules/node-sass/vendor'
- Luigi_K commented on June 10th 19 at 16:51
The rights to the node_modules folder was root, now its changed but still error
Error: EACCES: permission denied mkdir '/var/www/test.loc/node_modules/node-sass/build'
- Luigi_K commented on June 10th 19 at 16:54
have node 8+ not yet compatible with all modules. I am at the error "0 of undefined" I put NVM and Node 6 through it.x . This usually solves all problems

On the last screen access error. sudo ) - leonor36 commented on June 10th 19 at 16:57
I have also nvm and node, I got confused. - Luigi_K commented on June 10th 19 at 17:00
Hike I rights something namudrili, will be restored from backup. - Luigi_K commented on June 10th 19 at 17:03
I mean to try and use Node below the 8th and the unknown errors will not)

So you even with sudo Permission denied ? - leonor36 commented on June 10th 19 at 17:06
Recovered from backup, now I will try anew. - Luigi_K commented on June 10th 19 at 17:09
Thanks , you were right. I've installed nvm, but the source was in the file .zshrc. I used to use this shell, then moved on to bash, and remove forgot. Here from here and dance in your bash terminal nvm command not found. Two hours tormented until I realized what the problem is.
A second series of gulp-babel is just beginning. When finished, I will unsubscribe)) - Luigi_K commented on June 10th 19 at 17:12
and it really works well, set Node 6.12.2 - and no errors, yay, it works. And with babel no more problems.
What would I do without you? - Luigi_K commented on June 10th 19 at 17:15

Find more questions by tags npmGulp.jsJavaScript