Debug: npm WARN enoent ENOENT: no such file or directory, open '<root>/node_modules/supertest/package.json'

Created on 5 Jun 2017  路  12Comments  路  Source: visionmedia/debug

Hi,

I've got a problem here where using npm to reinstall appium has produced several errors.

Im trying to reinstall Appium and have tried to run the following commands to fix my problem with npm; "Clean Cache" & "re-install". Unfortunately it didn't fix it for me. Seems to have spawned another issue.

/Users/Karbon62/.npm/_logs/2017-06-05T14_42_36_153Z-debug.log

Logs that were generated before cleaning cache: file:///Users/Karbon62/.npm/_logs/2017-06-05T12_47_17_209Z-debug.log

Most helpful comment

run npm init and then you should be fine

All 12 comments

This is a very "unhelpful" error message. I get sometimes this error - I hope npm will give a more clear error message on this issue ("enoent ENOENT" it's like jibberish hhh). I saw a lot of StackOverflow Q about this error (again this unclear message).

Maybe try this:
https://stackoverflow.com/questions/31952747/npm-throws-enoent-warnings-on-every-install-uninstall-ls
Or:
https://stackoverflow.com/questions/9484829/npm-cant-find-package-json
https://www.npmjs.com/package/npm-autoinit

Basic:
https://docs.npmjs.com/getting-started/installing-npm-packages-locally

Anyway, i am not NPM master. I hope someone her will give you the best answer.

cheers @Siton-Systems, appreciate the help!

run npm init and then you should be fine

@Herod - i'm also getting the ENOENT error message.
after running npm init my terminal output is
```~ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See npm help json for definitive documentation on these fields
and exactly what they do.

Use npm install <pkg> --save afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
name: (Hyacinth)

```

This doesn't really have anything to do with the debug package here. ENOENT means Error: No Entity, otherwise known as "file not found". It is among the list of errno codes.

Not sure what the initial error message was about, but judging from the positive response to npm init as a 'solution' I'd guess you're seeing a _warning_ about package.json not being present. If so, you can either ignore it or create one yourself (npm init works just fine for this).

Closing since this isn't debug related :)

@Qix- Thank you kindly for the awesome clarification you provided. It's greatly appreciated.

npm cache clean
npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/sait110/.npm/_logs/2017-11-03T13_14_34_858Z-debug.log

npm cache clean
npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/sait110/.npm/_logs/2017-11-03T13_14_34_858Z-debug.log

npm install
npm WARN saveError ENOENT: no such file or directory, open '/home/sait110/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/sait110/package.json'
npm WARN sait110 No description
npm WARN sait110 No repository field.
npm WARN sait110 No README data
npm WARN sait110 No license field.

npm start
npm ERR! path /home/sait110/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/sait110/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

bower install
bower ENOENT No bower.json present

Run Npm init and create a package.json file yourself , worked like a charm for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Qix- picture Qix-  路  4Comments

realityking picture realityking  路  6Comments

jfoclpf picture jfoclpf  路  6Comments

anishkny picture anishkny  路  6Comments

kopax picture kopax  路  4Comments