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.

Uncaught Error: ENOENT: no such file or directory, open 'package.json'

See original GitHub issue

Reproduce:

  1. Run prettier command with open, unsaved .js file.

Atom: 1.16.0 x64 Electron: 1.3.13 OS: Mac OS X 10.11.6 Thrown From: prettier-atom package 0.30.0

Stack Trace

Uncaught Error: ENOENT: no such file or directory, open ‘package.json’

At fs.js:640

Error: ENOENT: no such file or directory, open 'package.json'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:168:20)
    at Object.fs.readFileSync (fs.js:508:33)
    at Object.fs.readFileSync (ELECTRON_ASAR.js:501:29)
    at /packages/prettier-atom/node_modules/load-json-file/index.js:11:38)
    at Function.module.exports.sync (/packages/prettier-atom/node_modules/read-pkg/index.js:40:25)
    at getDebugInfo (/packages/prettier-atom/dist/helpers.js:200:34)
    at displayDebugInfo (/packages/prettier-atom/dist/displayDebugInfo.js:7:14)
    at /packages/prettier-atom/dist/main.js:57:3)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at /app.asar/src/command-registry.js:3:59
    at Object.didConfirmSelection (/app.asar/node_modules/command-palette/lib/command-palette-view.js:106:29)
    at SelectListView.confirmSelection (/app.asar/node_modules/atom-select-list/src/select-list-view.js:292:20)
    at /app.asar/node_modules/atom-select-list/src/select-list-view.js:64:14)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at /app.asar/src/command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:390:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/app.asar/src/window-event-handler.js:106:36)
    at /app.asar/src/window-event-handler.js:3:59)

Commands

     -1:18.7.0 core:save (input.hidden-input)
  2x -0:58.1.0 core:move-up (input.hidden-input)
     -0:57.7.0 core:move-left (input.hidden-input)
     -0:53.5.0 editor:select-to-end-of-line (input.hidden-input)
     -0:53.5.0 core:select-left (input.hidden-input)
     -0:53.1.0 editor:select-to-beginning-of-word (input.hidden-input)
  2x -0:52.7.0 core:select-left (input.hidden-input)
     -0:52.2.0 core:copy (input.hidden-input)
     -0:52 core:move-right (input.hidden-input)
     -0:51 core:paste (input.hidden-input)
     -0:50.9.0 core:save (input.hidden-input)
     -0:37.7.0 core:cut (input.hidden-input)
     -0:37.6.0 core:save (input.hidden-input)
     -0:10.7.0 command-palette:toggle (input.hidden-input)
     -0:09.6.0 core:confirm (input.hidden-input)
     -0:09.6.0 prettier:debug (input.hidden-input)

Non-Core Packages

activate-power-mode 1.4.0 
atom-autocomplete-php 0.22.2 
atom-beautify 0.29.23 
busy-signal 1.4.1 
color-picker 2.2.5 
file-icons 2.1.4 
go-debug 1.3.1 
go-plus 5.5.1 
go-signature-statusbar 1.2.0 
hyperclick 0.0.40 
ide-purescript 0.17.2 
intentions 1.1.2 
language-docker 1.1.7 
language-elm 1.5.0 
language-javascript-jsx 0.3.7 
language-protobuf 0.7.1 
language-purescript 0.8.2 
language-rust 0.4.10 
linter 2.1.4 
linter-eslint 8.1.7 
linter-flow 5.6.0 
linter-php 1.3.2 
linter-rust 0.8.0 
linter-ui-default 1.2.3 
nuclide 0.223.0 
php-twig 4.0.0 
pigments 0.39.1 
prettier-atom 0.30.0 
racer 0.20.0 
react 0.16.2 
vim-mode-plus 0.91.0 

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16

github_iconTop GitHub Comments

2reactions
tbillingtoncommented, May 18, 2017

Confirming that the latest update has fixed the issue for me. Both the format and debug commands now work 😃 thanks!

1reaction
robwisecommented, May 12, 2017

@darahak just a heads-up, I’m in the process of a big refactoring of codebase’s file structure, I should be done sometime this weekend

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm WARN enoent ENOENT: no such file or directory, open 'C ...
It creates a package.json file in your folder. Then run,. C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm install socket.
Read more >
npm WARN enoent ENOENT: no such file or directory, open ...
Indeed what it wants is a package.json file, obtained by typing npm init. Then I was able to do an npm install with...
Read more >
How to fix: npm ERR! enoent ENOENT: no such file or ...
I recently struggled for a while with an npm error thrown when executing npm install of some package. The error message was npm...
Read more >
npm WARN enoent ENOENT no such file or directory open C ...
I just want to install socket.io to my project which is located on 3.chat folder. But when I run following command it shows...
Read more >
How to Fix npm ERR Code ENOENT npm ERR syscall Open ...
In This Video We Will See How to Fix npm ERR Code ENOENT npm ERR syscall Open Error or ENOENT No Such File...
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