Questions tagged [babel-node]

80 questions
0
votes
1 answer

babel-node Error: Cannot find module '../es'

When I run my app, I keep running into the below MODULE_NOT_FOUND error. I have cleaned Docker, yarn clean, restarted my computer, delete the repo and cloned an entirely new repo, and this error keeps happening. My colleagues do not run into this…
Jenna
  • 111
  • 2
  • 8
0
votes
1 answer

Node and Express server running on the terminal but web browser says "ERR_CONNECTION_REFUSED localhost refused to connect."

This is my Node.js code: // Using ES6 syntax is fine because we already have Babel to transpile code. import express from 'express'; // Create an Express application. const app = express(); // Define port number for the server. const PORT = 400; //…
Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103
0
votes
1 answer

Babel-node ignores or misbehaves when I add ignore option to babel.config.js

am using the command npx babel-node --ignore=' ' --extensions='.ts,.tsx,.js,.jsx,.es6,.es' test.js to compile the script named test.js . test.js imports import template from 'lodash-es/template'; and I would like it to be compiled too. Adding…
McKabue
  • 2,076
  • 1
  • 19
  • 34
0
votes
1 answer

Why isn't @babel/node transforming my code

I have a project created using babel-preset-react-app. I want to analyze some of my files at build/precommit by running a script with @babel/node. Unfortunately I'm getting the following error: trpgb21@development:~/develop/ts-demo-new$ DEBUG=*…
cphoover
  • 368
  • 3
  • 7
0
votes
0 answers

How to fix PM2 nodejs spawn babel-node ENOENT

I'm trying to run my nodejs project with PM2. Here's a part of my package.json { "scripts": { "pretest": "yarn run test-cleanup", "preinstall": "yarn global add pm2", "build": "rm -rf dist && babel src --out-dir dist…
0
votes
2 answers

for await (... of ...) not working. Babel present env, node v10

It's been a while since I started a nodejs project from scratch, so was a bit of a headscratcher to set up and configure eslint, babel etc. right now my babelrc is : { "presets": [ [ "env", { "targets": { "node":…
yen
  • 1,769
  • 2
  • 15
  • 43
0
votes
1 answer

Load/node-babel problem that appeared with VERY small changes in my typescript code?

I have a large project that works fine. Today I realized that I needed to make a change in one method in one class. So I changed one method in Task.destroy() by adding just one line: public destroy(clientId: string, userData: UserData, taskData:…
JoelParke
  • 2,676
  • 2
  • 24
  • 38
0
votes
1 answer

Nodemon and babel-node restart multiple times

I'm using nodemon with babel-node in development environment. I'm working on Windows 7 and every time I change my code, nodemon restart multiple times. I searched on google and even in stackoverflow and github, the temporary solution is just:…
trungducng
  • 395
  • 1
  • 7
  • 19
0
votes
1 answer

babel-node, cannot get server to listen on port

I am currently trying to run node es6 with babel on a docker container and am running into some issues getting the app to start listening on port 3000. I can see where the app.js file is being processed as I am seeing the database connection code…
user1790300
  • 2,143
  • 10
  • 54
  • 123
0
votes
0 answers

webpack likes my ES6 code, babel-node doesn't

I have a project that webpack happily builds with the webpack from below[1]. I want to interactively test the app so I try to use node-babel. Every time it complains about the syntax of my imports or exports. $ ./node_modules/.bin/babel-node…
Paul Prescod
  • 443
  • 1
  • 4
  • 17
0
votes
1 answer

How to make babel/register affect on imported files?

Below gulpfile.babel.js runs without error by babel-node gulpfile.babel.js (I know that to execute the gulp task I should to run gulp taskname, but babel-node gulpfile.babel.js is for debugging without running…
Takeshi Tokugawa YD
  • 670
  • 5
  • 40
  • 124
0
votes
2 answers

babel-node error 'Reference error: window is not defined'

I was given the task to implement server-side rendering for a react application. I've followed the this tutorial: https://scotch.io/tutorials/react-on-the-server-for-beginners-build-a-universal-react-and-node-app and, afterwards, followed the…
0
votes
0 answers

Running Angular Universe - cannot start server

I am following the steps (in https://malcoded.com/posts/angular-fundamentals-universal-server-side-rendering) to setup Angular Universe - I'm retrofitting it on top of an existing Angular 2 application. I am using node/npm on Windows. After the…
0
votes
1 answer

Babel-node cannot compile js under node_modules, how to resolve it?

I've struggled for this question for a long time, i've tried all possible solutions by google, but it still didn't work. Here, i set an brief example to describe the problem. Assume we created the structure: test | |____ test1.js | |____…
TerrySu
  • 158
  • 8
0
votes
1 answer

babel-node from cron job not working

I'm currently unable to run babel-node from a cron job. My code runs as expected when I manually run it, but the same code won't run from cron - here's my cron file: * * * * * cd /path/to/dir && /path/to/dir/node_modules/.bin/babel-node --presets…