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.

Trying prettier in emacs give errors (OSX)

See original GitHub issue

Here the error when trying to apply prettier on a buffer

prettier errors:
/Users/trigrou/.nvm/versions/node/v5.5.0/lib/node_modules/prettier/bin/prettier.js:4
const fs = require("fs");
^^^^^
SyntaxError: Use of const in strict mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

not sure exactly what’s the problem

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mlunoecommented, Mar 14, 2017

If anybody is wondering I had a similar issue for Sublime Text 3 and ended up setting the project settings to be using the same node as the prettier was installed with:

  "settings": {
    "js_prettier": {
      "prettier_cli_path": "/Users/ml/.nvm/versions/node/v4.4.4/bin/prettier",
      "node_path": "/Users/ml/.nvm/versions/node/v4.4.4/bin/node"
    }
  }

This was not super obvious to me when installed it and wanted to use it with my editor.

0reactions
vramanacommented, Jan 12, 2017

Looks like that’s an issue with your $PATH. Since this is not an issue related to prettier anymore, I am closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't get prettier-js working
Running M-q results in the error: Autoloading failed to define function prettier and using M-x prettier-js again results in Searching for ...
Read more >
prettier - require in .emacs config file not working
I have installed prettier for emacs using the instructions here: https://github.com/prettier/prettier-emacs. Doing which prettier gives me ...
Read more >
radian-software/straight.el - Gitter
hey all, I'm trying to set up straight on a branch new mac OS emacs 27.1 installation. Getting the following error: Debugger entered--Lisp...
Read more >
Emacs 29 is nigh
I personally try to use eshell for everything. As far as different tabs/splits emacs should be able to do that. Can you give...
Read more >
Formatting code with Prettier
The reason for being used prettier is given below: ... Providing the error message if the code is not followed any syntax, will...
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