“SyntaxError: Cannot use import statement outside a module”: occurs on Ubuntu, but not on Windows
Mia Lopez
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 moduleEverywhere 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?
6 Reset to default