Error: ENOENT, readdir 'C:\Users\######\AppData\Roaming\npm\node_modules'
As a complete newbie to JS I'm using Brackets to code some simple HTML and JavaScript.
All ran fine yesterday and the only change I made today was to disable JSLint in favour of ESLint by deleting the relevant extension folder.
I also disabled extensions (Brackets Icons + W3CValidation) but I don't see this being related.
Now for some reason I'm getting this error.
C:\Users#######\AppData\Roaming\npm\node_modules ....does not exist
I do have C:\Users\fergus\AppData\Roaming\npm but it only contains a folder called 'etc' and I have looked on my drive and there is no 'node_modules' folder anywhere!!
I have set up many IDEs and development environments including Oracle servers but I have never encountered so many problems as I have trying to get a simple piece of JS to run. Any help would be appreciated
COPIED FROM CONSOLE:
ErrorNotification.js:125 [node-error 2:16:31 PM] Error: ENOENT, readdir 'C:\Users######\AppData\Roaming\npm\node_modules' window.console.error @ ErrorNotification.js:125
123 window.console.error = function () { 124 incErrorCount(); 125 return _consoleError.apply(window.console, arguments); 126 };
In which directory does your application live? Does this directory have a node_modules folder? Have you tried (re)installing npm?
Please provide more insights on what you are trying to achieve.
Brackets: C:\Program Files (x86)\Brackets C:\Users\MyUserDir\AppData\Roaming\Brackets My Brackets Projects: C:\Users\MyUserDir\Documents\BracketsProjects\Module4_2 Nodejs: C:\Program Files\nodejs NPM: C:\Users\MyUserDir\AppData\Roaming\npm-cache C:\Users\MyUserDir\AppData\Roaming\npm
As already stated there is no node_modules folder anywhere. I wasn't even aware I needed one and yesterday my project worked and I don't see how a node_modules folder could have disappeared since then. I have installed NPM 3 times and I'm not doing it again I am so fed up with trying to get this to work. I am using Brackets and to make use of ESLint I had to install brackets-npm-registry...why? I don't know I'm afraid to ask because I won't understand. And to install brackets-npm-registry I'm also advised to have node.js...why? I don't know I'm just doing what I'm told. I don't have time to look into the ins and out I just want to write some JS in Brackets and use ESLint. I'm at the point where I really don't have time or patience for this any longer. Nobody seems to be too interested in explaining the basics of why, if you don't already know your f@#ked and few people can be bothered to explain.
Sorry for the tone of this but I have never had so many problems before in computing as I've had trying to set this up.
Relax. I'm here to help. :)
I have to confess that I am not a big Node on Windows expert and that I don't use brackets but Webstorm and Visual Studio Code. Differently than in - say - regular Visual Studio the "build environment" is not really part of the IDE - all Node needs to run is the Node executable.
The dependencies of any project are maintained in a file called package.json. It lives in the root directory of your project.
If you have a package.json, chances are high that you will be up and running by simply running the command npm install from the root directory of your project. It will install all dependencies into a folder called node_modules within your project directory.
Every time you do a require('foo') node will first try to find foo in node_modules and if it doesn't find it there it will try to find it globally.
I suspect that you lost the local node_modules folder and that node does now try to find a module globally.
So - is there a package.json in your project root and if so what happens if you do a npm install?
Thank you for suggesting a solution.
Incidentally I was thinking of used Visual Studio Code for JS. How was it to set up and I'm wondering if it would be easier than my current setup. What do you think? As regards getting going on VSC & JS are there any sites you could recommend of a newbie? Thanks
Actually any text editor will do. IDEs just add some intellisense, code coloring and code formatting when it comes to node. So if you install VSC and open any node project with it, you are good to go.
I would recommend starting on the shell to see how things actually fit together before using the IDE. This is maybe a 30 minutes effort but pays back big time.
Okay if I was just doing client side JS for now would VSC be a worthwhile solution for now.
If it's client side then it's not Node.js. Anyways - sure VSC does regular HTML and JavaScript as well.
Okay thanks for you help ;)
Issue not solved yet
error: ENOENT: no such file or directory, open 'C:\Users\Mehaboob Hombal\AppData\Roaming\npm\node_modules\live-server\node_modules\fsevents\package.json
How to solve this Error Please Help me anyone i stucked here i m not able to install proper npm packages so its not creating react app so please help me