debug icon indicating copy to clipboard operation
debug copied to clipboard

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

Open Lisa-V-Sau opened this issue 9 years ago • 12 comments

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

Lisa-V-Sau avatar Jun 05 '17 14:06 Lisa-V-Sau

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.

Ezra-Siton-UIX avatar Jun 12 '17 11:06 Ezra-Siton-UIX

cheers @Siton-Systems, appreciate the help!

Lisa-V-Sau avatar Jun 14 '17 09:06 Lisa-V-Sau

run npm init and then you should be fine

ghost avatar Jul 27 '17 03:07 ghost

@Herod - i'm also getting the ENOENT error message. after running npm init my terminal output is

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)


Karla-Isabel-Sandoval avatar Aug 25 '17 01:08 Karla-Isabel-Sandoval

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- avatar Aug 25 '17 04:08 Qix-

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

Karla-Isabel-Sandoval avatar Aug 26 '17 00:08 Karla-Isabel-Sandoval

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

yogeshwar143 avatar Nov 03 '17 13:11 yogeshwar143

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

yogeshwar143 avatar Nov 03 '17 13:11 yogeshwar143

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.

yogeshwar143 avatar Nov 03 '17 13:11 yogeshwar143

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

yogeshwar143 avatar Nov 03 '17 13:11 yogeshwar143

bower install bower ENOENT No bower.json present

yogeshwar143 avatar Nov 03 '17 13:11 yogeshwar143

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

hacktivist123 avatar Nov 18 '17 16:11 hacktivist123