“Syntaxerror: Cannot Use Import Statement Outside a Module”: Occurs on Ubuntu, but Not on Windows
I Work with This Assembly: It Works for Me on Windows. but on Ubuntu, Right After the Run Command (Gulp, or Npm Run Dev, or Yarn Run Dev) Does Not Start and...
I work with this assembly:
It works for me on Windows. But on Ubuntu, right after the run command (gulp, or npm run dev, or yarn run dev) does not start and gives the following error:
paranoic:~/PhpstormProjects/20_18$ gulp
[14:27:25] Requiring external module @babel/register
/home/paranoic/PhpstormProjects/project10/gulpfile.babel.js:3
import gulp from "gulp";
^^^^^^
SyntaxError: Cannot use import statement outside a module
Everywhere they write that these are troubles with babel. But why are they on one OS and not the other?
I have already taken the following measures, but they did not work:
Just in case, I checked some other assembly is running on Ubuntu. There is an assembly without imports - it starts
I changed the version of node to the one that supports modules and added an entry "type": "module" to the package
What should I do to make the build work on Ubuntu?