question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when running npm start with babel-node

See original GitHub issue

When i run the babel-node enabled package.json file I receive an error. Output from npm-debug.log below:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ] 2 info using npm@3.10.10 3 info using node@v6.11.3 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle javascript-development-environment@1.0.0~prestart: javascript-development-environment@1.0.0 6 verbose lifecycle javascript-development-environment@1.0.0~prestart: unsafe-perm in lifecycle true 7 verbose lifecycle javascript-development-environment@1.0.0~prestart: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/[username]/Documents/MIM Practice/js-dev-env/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 8 verbose lifecycle javascript-development-environment@1.0.0~prestart: CWD: /Users/[username]/Documents/MIM Practice/js-dev-env 9 silly lifecycle javascript-development-environment@1.0.0~prestart: Args: [ '-c', 'babel-node buildScripts/startMessage.js' ] 10 silly lifecycle javascript-development-environment@1.0.0~prestart: Returned: code: 1 signal: null 11 info lifecycle javascript-development-environment@1.0.0~prestart: Failed to exec prestart script 12 verbose stack Error: javascript-development-environment@1.0.0 prestart: babel-node buildScripts/startMessage.js12 verbose stack Exit status 1 12 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16) 12 verbose stack at emitTwo (events.js:106:13) 12 verbose stack at EventEmitter.emit (events.js:191:7) 12 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14) 12 verbose stack at emitTwo (events.js:106:13) 12 verbose stack at ChildProcess.emit (events.js:191:7) 12 verbose stack at maybeClose (internal/child_process.js:920:16) 12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5) 13 verbose pkgid javascript-development-environment@1.0.0 14 verbose cwd /Users/[username]/Documents/MIM Practice/js-dev-env 15 error Darwin 17.0.0 16 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 17 error node v6.11.3 18 error npm v3.10.10 19 error code ELIFECYCLE 20 error javascript-development-environment@1.0.0 prestart:babel-node buildScripts/startMessage.js20 error Exit status 1 21 error Failed at the javascript-development-environment@1.0.0 prestart script 'babel-node buildScripts/startMessage.js'. 21 error Make sure you have the latest version of node.js and npm installed. 21 error If you do, this is most likely a problem with the javascript-development-environment package, 21 error not with npm itself. 21 error Tell the author that this fails on your system: 21 error babel-node buildScripts/startMessage.js 21 error You can get information on how to open an issue for this project with: 21 error npm bugs javascript-development-environment 21 error Or if that isn't available, you can get their info via: 21 error npm owner ls javascript-development-environment 21 error There is likely additional logging output above. 22 verbose exit [ 1, true ]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
magdalenagoreckacommented, Oct 8, 2017

The issue is with .babelrc When I changed it to babel-recommended

{"presets": [
  ["env", {
    "targets": {
      "node": "current"}
  }]
]
}

it worked just fine.

0reactions
M-Teecommented, Nov 16, 2020

The issue is with .babelrc When I changed it to babel-recommended

{"presets": [
  ["env", {
    "targets": {
      "node": "current"}
  }]
]
}

it worked just fine.

This worked for me though I had to replace "env" with "@babel/env"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Babel error while running npm start - M220JS - MongoDB
/home/bibek/project/node/mongo/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180
Read more >
How do I resolve "npm run babel" error in VS code?
What am trying to do is convert modern javascript code to old code using babel. When I hit enter on "node_modules/.bin/babel src/index.js -o ......
Read more >
babel-watch - npm
Start using babel -watch in your project by running `npm i babel-watch`. There are 41 other projects in the npm registry using babel-watch....
Read more >
babel/node - Babel.js
babel -node is a CLI that works exactly the same as the Node.js CLI, with the added benefit of compiling with Babel presets...
Read more >
Quick Set up Babel to Compile Es6+ Javascript codes in Node ...
Run npm install @babel/cli --save to install babel-cli. You may want to include a babel script in ... npm run babel test.js --...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found