Questions tagged [babel-node]

80 questions
58
votes
6 answers

debugging in Visual Studio Code with babel-node

I'm using: VS Code v1.3.1 node v6.3.1 babel-node v6.11.4 Windows 10 I'm unable to get a stop at a breakpoint with the following launch file. The debugger runs and attaches to a port, but when I run the applications with a breakpoint, it doesn't…
restassured
  • 1,008
  • 2
  • 9
  • 12
24
votes
1 answer

Babel-node doesn't transform spread operator on preset env

I'm trying to use babel-node with nodemon for the hot-reloading. I've basically followed this repo. My dev script in package.json looks like that: "dev": "nodemon app.js --exec babel-node --presets env" My .babelrc: { "presets": ["env"] } Even…
Philip Feldmann
  • 7,887
  • 6
  • 41
  • 65
14
votes
7 answers

How to use babel-node with pm2

I want to manage my node process with pm2 package. If I don't have any es6 syntax in my code so I don't need to add babel-node, and without any es6 syntax code is am able to run my code with pm2 with this line of code pm2 start server.js But as…
jsDevia
  • 1,282
  • 4
  • 14
  • 37
14
votes
1 answer

babel-node vs babel-register in development

Is there any difference between using babel-register or babel-node when running my code in development? The two options are: require('babel-register')({ "presets": ["es2015"] }); at entry-point.js and npm start script node entry-point.js simply…
shayac
  • 584
  • 3
  • 10
10
votes
6 answers

Nodemon + babel restart the server multiple times

In my package.json I have a start-script which I'm using for my dev enviroment. It looks like this: "scripts": { "dev": "NODE_PATH=src nodemon --watch src/ --exec babel-node src/app.js" } When I'm hitting npm run dev everything works fine and…
Jonathan Nielsen
  • 1,442
  • 1
  • 17
  • 31
10
votes
1 answer

Running babel-node in visual studio code

Normally to start up via command line, I can type: babel-node server.js When I try to set this up so that breakpoints and what not work in visual studio code I receive: /Users/me/proj/node_modules/babel-cli/lib/babel-node.js --debug-brk=31893…
Prescott
  • 7,312
  • 5
  • 49
  • 70
9
votes
0 answers

Using source maps when debugging babel-watch output

Using babel-watch, when debugging through the Chrome inspector, I don't have source maps available. When running the same code using babel-node, with the same .babelrc, source maps are available. Here is my .babelrc: { "presets": [ …
Fela Maslen
  • 2,022
  • 3
  • 25
  • 46
8
votes
1 answer

Node.js command line script sometimes does not terminate

I have a node js script with an async main method. Sometimes the script terminates fine, other times it hangs. const main = async () => { let updates = [] // ... add a bunch of promises to updates await Promise.all(updates) }…
Eric Conner
  • 10,422
  • 6
  • 51
  • 67
6
votes
1 answer

babel-node installation "Only RSA and DSA public keys are allowed"

I'm having trouble installing babel-node npm i -g babel-node > babel-node@6.5.2 postinstall /Users/.../.../node_modules/babel-node > node message.js; sleep 10; exit 1; /Users/.../.../node_modules/ssh-key-to-pem/index.js:210 throw new…
Timmerz
  • 6,090
  • 5
  • 36
  • 49
5
votes
2 answers

how to set nodejs command `--max-http-header-size` with `nodemon --exec "babel-node" .`

I am upgrading my nodejs version from 8 to 10. after upgraded, i can't run my application in any browsers right now. so i've been googled my issue and found out that header size of node 10 has been downsized to 8kb from 80kb. my application header…
Kaslie Kaslie
  • 51
  • 1
  • 1
  • 3
5
votes
1 answer

How to fail a gitlab-ci job from node.js

On a giltab ci job I am running a node.js script where I evaluate some conditions, and where I might want to force the job to fail. The script is written in es6 and is ran with yarn and babel-node yarn babel-node ./script-in-es6.js. When the…
Marcio Oliveira
  • 791
  • 1
  • 5
  • 18
5
votes
3 answers

How to use babel-preset-env with Jest

We are in the midst of updating our API, and Henry Zhu from Babel alerted me to this preset called babel-preset-env to replace need for babel-preset-es2015 and babel-preset-es2018. Now, I am encountering difficulty understanding the simplest way to…
agm1984
  • 15,500
  • 6
  • 89
  • 113
4
votes
1 answer

How to get babel-node to convert files referenced by Workers to commonjs? (like babel does)

In an Express.js app, I'm using Babel to precompile to commonjs before starting it. The compilation step looks like this: babel ./src --out-dir dist node ./dist/bin As part of the project I have a file called my-worker.js where I use import…
Zach Smith
  • 8,458
  • 13
  • 59
  • 133
4
votes
2 answers

How to configure babel correctly to use lodash-es?

I need to use lodash-es in my project, but I can't configure my babel correctly, it always reports errors like SyntaxError: Unexpected identifier hello.js import upperCase from…
Freewind
  • 193,756
  • 157
  • 432
  • 708
4
votes
1 answer

Import es6 module in repl

I wrote an es6 module that I'm transpiling with Babel.js and packaging with Webpack. I would like to be able to load this module into a repl so that I can use it there, so I installed babel-cli to get babel-node. I saw the notice saying that…
Brian McCutchon
  • 8,354
  • 3
  • 33
  • 45
1
2 3 4 5 6