NPM Install ENOENT no such file or directory - node.js

I'm getting this error when running npm install --save-dev gulp-coffee
ENOENT: No such file or directory
I have a package.json file in my root directory though
Didn't have any issues yesterday installing node modules but today I can't install dependencies

nothing seemed to work from other similar problems on stackoverflow, I ended up just deleting my repo. Then:
git clone [my github url repo]
cd [folder with node dependencies]
npm install (installs node packages based on root package.json file)
Run my gulp commands to test gulp watch, modified files being watched to see if gulp was working as intended. check to see files being changed as intended via git diff
Worked fine for me, it doesn't solve the original problem. Not sure why my package.json files were missing or why I could not repopulate them with a npm init

Related

Issue cloning every repository

I have been cloning repositories with node and MongoDB but I always run into issues running npm install when I cd into the folder directory.
It has to be me because I happens every time. What am I missing?
Seems like npm install is the 3rd step after 1: git clone "repository link", 2: cd in clone folder.
Please guide me in the right direction.
Thanks a ton
You can run npm install from a directory where package.json file is located since this is the one which holds all the info regarding packages.
So just try to make it sure that the directory from where you are firing npm install command, have package.json file.
Apart from this, just check if you have npm installed. Run npm -v

npm errors and warnings in terminal

can anybody tells me what are those errors about and how to fix them?
Everytime i try to install something in node with npm these errors show up in terminalenter image description here
ENOENT stands for basically "Error, No Entry". this means it was looking for the package.json file and it couldn't find it.The fields mentioned below are also not found because they are a part of the package.json file
so create a package.json file in the current current directory using
npm init
and add the required content in the required fields
i would also recommend you to install the modules locally into the directory of the particular project using
npm install express --save
Hope my answer helps,
cheers
The error you are facing is because you do not have package.json file. Npm installs the package in a node_modules/ subfolder, but warns you that there is no package.json file. If you want to manage localy installed npm packages you should create a package.json file. Start by creating an empty folder:
$ mkdir myapp
$ cd myapp
and then create a new package.json executing
$ npm init
Answer (or skip) all questions and at the end a brand new package.json will be created.
You can get more information from the Getting started articles in npm documentation: Working with package.json

npm install resulting in 'ENOENT: no such file or directory'

I've installed Node.js for Windows and I'm trying to install a package via npm. The command prompt is in the directory of the project (C:\Users\username\Desktop\NodeTest), which contains a single helloworld.js file. Upon typing 'npm install express', I receive the following error:
ENOENT: no such file or direcotry, open 'C:\Users\username\package.json
I'm attempting this from a clean install and cmd is running as admin.
Any ideas?
I was facing the same issue. I firstly delete my node_modules and delete the cache by following command:
rm -rf node_modules && npm cache clean --force
then I delete the package-lock.json file from my project and then hit npm install in command prompt and it works.
As already pointed out by Subburaj this is because you are missing a package.json.
Just run npm init to initialize that file for you; afterwards it should work.
If you are working on a Windows machine using Vagrant/VM, there's a chance that symlinks are the culprit for your problem. To determine if that is the case, simply copy your package.json and package-lock.json into a test directory that is not mounted/shared between OSs.
mkdir /tmp/symlinktest
cd {{your directory with your package*.json}}
cp package*.json /tmp/symlinktest
cd /tmp/symlinktest
npm install
If this results in a successful install, you'll need to either exclude the node_modules directory from the mount (there's various articles on doing this, however I can't say I've had success) or run npm install outside the mounted volume.
I deleted the package-lock.json and It worked for me.
Basically I was Offline while I tried to install with npm, so go online and try
npm install again
Check the project folder which you opened in microsoft visual code. Generally you are not in the right path so npm is not able to search the package.json ... My project was in Document/hostel/hostel .. I opened Document/hostel ... So npm tried to find the package.json in Documents folder .. When i entered one level inside to Document/hostel/hostel .. it was fixed.

grunt install error: unable to find local grunt

I'm trying to run grunt but receiving this error. I have grunt installed globally and can run 'grunt watch' from other locations and it works for other files. I have a new project given to me which has less files, and it contains a package.json file (this seems buried, where I'd assume it should be closer to the root but I'm new to this). I try to run grunt watch from the root and receive the error message above. The package.json does not list grunt files as dependencies. Any help is appreciated. Thanks
The error is telling you that it's missing locally. npm scripts run things out of the node_modules directory, so install grunt locally to resolve it.
npm install grunt --save-dev

write module: npm install missing dist css files

I'm writting a small module
now install it somewhere
cd /tmp
npm install git://xxxx/GongT/mymdl.git
install complete successfull
but file "global.css" gone from node_modules/mymdl/dist/ folder.
I'm sure that file node_modules/mymdl/dist/global.css is in my git repo
whats happend here?

Resources