Skip to content

Instantly share code, notes, and snippets.

@chapov
Last active January 11, 2022 12:24
Show Gist options
  • Save chapov/4fe71dacd1c00e9d60fd8385122baff0 to your computer and use it in GitHub Desktop.
Save chapov/4fe71dacd1c00e9d60fd8385122baff0 to your computer and use it in GitHub Desktop.
Fix for cannot use import statement outside a module
npm install --save-dev @babel/core @babel/cli @babel/node @babel/preset-env @babel/plugin-transform-runtime
package.json
"scripts": {
"dev": "cross-env NODE_ENV=development CHOKIDAR_USEPOLLING=true nodemon server.js --exec babel-node",
},
.babelrc
{
"presets": ["@babel/preset-env"],
"plugins": [
["@babel/plugin-transform-runtime"]
]
}
this -s for Windows WSL2:
CHOKIDAR_USEPOLLING=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment