- npm install Windows — npm WARN saveError ENOENT: no such file or directory #2145
- Comments
- kn9 commented Mar 21, 2018
- r15ch13 commented Mar 21, 2018
- chisumo2016 commented Nov 14, 2018 •
- trynx commented Dec 3, 2018
- rahulKuthuru commented Jan 30, 2019
- omar-bakhsh commented May 15, 2019
- virinchimanepalli commented Jul 9, 2019
- israeldavid commented Dec 26, 2019
- npm install resulting in ‘ENOENT: no such file or directory’
- 5 Answers 5
- Not the answer you’re looking for? Browse other questions tagged node.js npm or ask your own question.
- Related
- Hot Network Questions
- Subscribe to RSS
- NPM: ENOENT: no such file or directory, rename
- 13 Answers 13
- NPM “ENOENT: no such file or directory error” when installing Sails.js dependencies with Node 8.9.4 LTS
- 10 Answers 10
- Can’t NPM Install: ENOENT: no such file or directory .staging/core-js-c2a9e69c (solved with rm -rf node_modules && npm install ) #9474
- Comments
- mintplugins commented Aug 30, 2018
- Soean commented Aug 30, 2018 •
- mintplugins commented Aug 30, 2018
- mintplugins commented Aug 30, 2018
- kienstra commented Sep 2, 2018 •
- danielbachhuber commented Sep 11, 2018
- ntwb commented Sep 11, 2018
- danielbachhuber commented Sep 11, 2018
- mintplugins commented Sep 11, 2018
- mintplugins commented Sep 11, 2018
- viskpan commented Dec 3, 2018
- azanwar30 commented Jan 9, 2019
- TechNov commented Jan 31, 2019
- ismaildenzzz commented Feb 3, 2019
- chenyang48671155 commented Feb 14, 2019
- rafalfaro-actr commented Mar 15, 2019 •
- cs-manughian commented Apr 22, 2019
- t-bee commented May 3, 2019
- nealeu commented Jun 3, 2019
- CoderHana commented Jul 27, 2019
- cemilakkoc commented Jul 30, 2019
- sergegl commented Aug 8, 2019
- rohanx25 commented Oct 16, 2019 •
- danny-p93 commented Oct 23, 2019
npm install Windows — npm WARN saveError ENOENT: no such file or directory #2145
Comments
kn9 commented Mar 21, 2018
Hi Guys, Please how do I resolve this error Please.
PS C:\Users\aa\scoop> scoop install nodejs —global
Installing ‘nodejs’ (9.8.0) [64bit]
Loading node-v9.8.0-win-x64.7z from cache
Checking hash of node-v9.8.0-win-x64.7z. ok.
Extracting. done.
Linking C:\ProgramData\scoop\apps\nodejs\current => C:\ProgramData\scoop\apps\nodejs\9.8.0
Adding C:\ProgramData\scoop\shims to global path.
Persisting bin
Persisting cache
Running post-install script.
‘nodejs’ (9.8.0) was installed successfully!
PS C:\Users\aa\scoop> npm install
npm WARN saveError ENOENT: no such file or directory, open ‘C:\Users\aa\scoop\package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\aa\scoop\package.json’
npm WARN scoop No description
npm WARN scoop No repository field.
npm WARN scoop No README data
npm WARN scoop No license field.
The text was updated successfully, but these errors were encountered:
r15ch13 commented Mar 21, 2018
This is not a problem with scoop.
NPM is for installing nodejs dependencies. You have to run it inside a nodejs project folder or use it to install a nodejs program globally ( npm install -g bower )
See https://docs.npmjs.com/
chisumo2016 commented Nov 14, 2018 •
/Desktop/Sites_Project/travel-site
$ npm install jquery
npm WARN saveError ENOENT: no such file or directory, open ‘C:\Users\buda\package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\buda\package.json’
npm WARN bundalla No description
npm WARN bundalla No repository field.
npm WARN bundalla No README data
npm WARN bundalla No license field.
- jquery@3.3.1
updated 1 package and audited 1 package in 6.059s
found 0 vulnerabilities
trynx commented Dec 3, 2018
I had the same problem and it just was a mistake of not being in the folder of the node it self.
@chisumo2016 as r15ch13 already said try to see that your directory ‘C:\Users\buda’ is the one which the project is in.
rahulKuthuru commented Jan 30, 2019
@trynx can you elaborate a bit more on what has to be done
omar-bakhsh commented May 15, 2019
/Desktop/project
$ npm install
npm WARN saveError ENOENT: no such file or directory, open ‘C:\Users\Amoory.SO\package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\Amoory.SO\package.json’
npm WARN Amoory.SO No description
npm WARN Amoory.SO No repository field.
npm WARN Amoory.SO No README data
npm WARN Amoory.SO No license field.
audited 1553 packages in 3.217s
found 0 vulnerabilities
virinchimanepalli commented Jul 9, 2019
use npm install -g express
israeldavid commented Dec 26, 2019
nothing i try all this solution doesnt work no one,
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.
5 Answers 5
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.
I was facing the same issue. I firstly delete my node_modules and delete the cache by following command:
then I delete the package-lock.json file from my project and then hit npm install in command prompt and it works.
Basically I was Offline while I tried to install with npm, so go online and try npm install again
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.
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.
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.
Not the answer you’re looking for? Browse other questions tagged node.js npm or ask your own question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
NPM: ENOENT: no such file or directory, rename
I was using gulp on the project, then i decide to deleted all the dev dependencies to switch to webpack, but every time i try to install using npm is get this error:
any idea what can be happening.
13 Answers 13
just delete package-lock.json file and then install packages, that’s all you need and should be works
When I got this error I looked for all running instances of node in my task manager (i use process explorer on windows) and close/kill all running instances of node. For me its often webstorm or vs code. After closing these programs and ensuring there is no running node process npm install works again.
cache verify command resolved the issue for me
I found a solution for the problem, apparently is some kinda problem with the last version of npm, i was using npm version 5.6.0 and i downgraded to npm version 5.3.0 . This did work after all, after intall a couple packages i still get the same error.
ok change version of npm for the last version 5.8.0 now everything working just perfect, before was some kind of problem with atom that denied the permission the building process to install the dependencies of the package.
NPM “ENOENT: no such file or directory error” when installing Sails.js dependencies with Node 8.9.4 LTS
I recently upgraded my computer and with it, to the latest LTS version of Node and NPM:
I have a Sails.js 0.12.14 application for which I’m trying to install NPM dependencies with npm install but when I do that, I get the following errors:
I can’t seem to figure out what’s going on and can’t find suitable answers anywhere else online. I even ran npm cache clean —force , rm -rf node_modules and retried with similar errors. It seemed to work fine when I was on Node
6 but after upgrading to Node 8.9.4 and NPM 5.6.0, it just won’t install my dependencies. How can I resolve this?
10 Answers 10
Try deleting the package-lock.json file.
No permission, no internet issue, it’s just a general issue of npm . I solved the problem with yarn.
Or you can use no-optional flag.
Deleting and regenerating ‘package-lock.json’ usually solves this issue however that’s inherently risky because you will likely be upgrading multiple packages at a time.
In my case it turned out that there was one specific package version that package-lock.json was referencing, that was 5 levels deep in the dependency. That version no longer existed at the npm registry so it caused the install to break. I had to find which package was pulling in this dependency and upgrade that one to resolve the issue.
For me, it turned out these errors were hiding the real underlying problem, which was that my credentials for a third-party npm repository (azure devops) had expired. I had to re-run vsts-npm-auth -config .npmrc to update the token in my .npmrc file.
Just delete package-lock.json file and then install package(s) you want. All will work.
I was struggling with this for awhile, and it seems be be related to the following.
Let’s say you have 3 modules, A, B and C
Module A includes B and C directly Module B also includes module C, in it’s package.json dependencies.
If your package.json dependencies in module A look like the following:
You will get the above error you mentioned, ENOENT, blah, blah in .staging
If on the other hand you include the module with the nested include first like:
The error goes away. This seems like a bug in npm with nested dependencies, and the error messages and logs were not very descriptive. Check your dependency tree and see if you have the described case, if so, that is your issue.
Can’t NPM Install: ENOENT: no such file or directory .staging/core-js-c2a9e69c (solved with rm -rf node_modules && npm install ) #9474
Comments
mintplugins commented Aug 30, 2018
Describe the problem
When attempting to run npm install in the Gutenberg directory, it fails with this error:
`ENOENT: no such file or directory, rename ‘[removed path to my local WP enironment]/wp-content/plugins/gutenberg/node_modules/.staging/core-js-c2a9e69c’ -> ‘[removed path to my local WP enironment]/wp-content/plugins/gutenberg/packages/hooks/node_modules/core-js’
To Reproduce
Steps to reproduce the behavior:
- Install Local by Flywheel and install WordPress.
- Clone gutenberg repo into the wp-content/plugins directory
- Attempt to run npm install while in that directory in Terminal on Mac
- Error above happens and npm is not installed.
Expected behavior
I expect NPM to install without any issues.
Desktop (please complete the following information):
- OS: OSX Version 10.11.6
- Browser: Chrome Version 68.0.3440.84
** Additional Information**
The node_modules directory does get created before it fails, and I see a .staging file in that directory during setup, but it is ultimately removed by the time the error happens in Terminal. See screenshot of node_modules directory:
Any assistance would be highly appreciated.
The text was updated successfully, but these errors were encountered:
Soean commented Aug 30, 2018 •
Delete package-lock.json and run npm install .
Hey @mintplugins,
which version of node and npm do you use?
Are you using Malwarebytes on your computer?
mintplugins commented Aug 30, 2018
@Soean Thanks for the response.
NPM version: 5.6.0
Node version: v8.11.4
I do not use Malwarebytes .
Unfortunately, deleting package-lock.json did not result in any changes while running npm install . I am still getting the same error.
mintplugins commented Aug 30, 2018
I just upgraded NPM to version 6.4.1, but it did not result in any changes either. I am still getting the same error.
kienstra commented Sep 2, 2018 •
@mintplugins, thanks for opening this issue.
After running npm install , I’m also seeing a similar error message to the one you reported.
Node: v8.11.4
NPM: v6.4.1
danielbachhuber commented Sep 11, 2018
I’ve run into this issue quite often
1 month ago. rm -rf node_modules && npm install resolves the issue for me.
@ntwb Is this issue being tracked somewhere?
ntwb commented Sep 11, 2018
Not tracked anywhere, it’s a common issue, maybe it should be documented in the repo somewhere
danielbachhuber commented Sep 11, 2018
maybe it should be documented in the repo somewhere
I wasn’t able to find a good place for this in our existing documentation. We have CONTRIBUTING.md , but it doesn’t have a section for debugging / known issues like this. Plus, the issue would ideally be resolved, not something developers have to live with.
With this being said, searching GitHub issues is fairly standard practice. Given the specificity of this error, I think we can have it live in GitHub issue history for now.
mintplugins commented Sep 11, 2018
@danielbachhuber I tried running the code you provided, but after running it, which took about 20 minutes to complete, I tried to run npm install again, and unfortunately I am still getting the exact same error. That code does not seem to have resolved anything in my situation.
mintplugins commented Sep 11, 2018
@danielbachhuber False alarm — it does seem to have worked now! Great — thank you!
viskpan commented Dec 3, 2018
Close the vs code and go to directory via terminal and install npm from the terminal.
azanwar30 commented Jan 9, 2019
My node version is 8.12.0
npm version is 6.4.1
I also got this issue today only & I have resolved it by removing package-lock.json file & then try to install packages with —unsafe-perm
Example —
rm -rf package-lock.json
npm install pachageName —unsafe-perm
It works for me
TechNov commented Jan 31, 2019
on windows, run terminal as Administratior work fine for me
ismaildenzzz commented Feb 3, 2019
If there is a character or a space other than the English characters from the user name, it can also be caused by this.
I’m talking about the installation of global packages. If you are installing a package on a specific project, it may also be caused by the lack of package.json.
chenyang48671155 commented Feb 14, 2019
How do you solve this problem?
rafalfaro-actr commented Mar 15, 2019 •
In my case npm set strict-ssl false
cs-manughian commented Apr 22, 2019
In my case, I removed the node_modules folder and the package-lock.json and then I was able to successfully run npm i .
t-bee commented May 3, 2019
Close the vs code and go to directory via terminal and install npm from the terminal.
It works, thanks mate.
nealeu commented Jun 3, 2019
I’ve just come across this and thought it worth adding my experience with the same error.
Our build passes, but executing the same commands locally doesn’t.
One thing I found was that our build (on Bitbucket Pipelines) was using npm install rather than npm ci . It seems that this is essential for repeatable builds.
CoderHana commented Jul 27, 2019
I’ve tried to install the package in CMD instead of the terminal of the VSCode. use CMD (Command Prompt). it works for me
cemilakkoc commented Jul 30, 2019
That may sound a bit weird but i fixed it by creating a new folder in a different path.
sergegl commented Aug 8, 2019
Some of my co-workers are getting the same error, I have an angular 8 — nx project, that i put on our internal source control. my local and build machines works fine, some people get «npm WARN tar ENOENT: no such file or directory, open. » when running npm install.
I did try deleting the node_packages folder, deleting package-lock.json, updating node etc..
So far i have no clue why it’s happening.
rohanx25 commented Oct 16, 2019 •
I am still getting same issue
`npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted <"os":"darwin","arch":"any">(current: <"os":"win32","arch":"x64">)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\karma\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted <"os":"darwin","arch":"any">(current: <"os":"win32","arch":"x64">)
npm ERR! path D:\Code\PWA\PWA — Working Model\Angular Model\angularpwa\node_modules.staging\typescript-33007fc3\lib\tsserverlibrary.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink ‘D:\Code\PWA\PWA — Working Model\Angular Model\angularpwa\node_modules.staging\typescript-33007fc3\lib\tsserverlibrary.js’
npm ERR! < [Error: EPERM: operation not permitted, unlink 'D:\Code\PWA\PWA - Working Model\Angular Model\angularpwa\node_modules.staging\typescript-33007fc3\lib\tsserverlibrary.js']
npm ERR! cause:
npm ERR! < Error: EPERM: operation not permitted, unlink 'D:\Code\PWA\PWA - Working Model\Angular Model\angularpwa\node_modules.staging\typescript-33007fc3\lib\tsserverlibrary.js'
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘unlink’,
npm ERR! path:
npm ERR! ‘D:\Code\PWA\PWA — Working Model\Angular Model\angularpwa\node_modules\.staging\typescript-33007fc3\lib\tsserverlibrary.js’ >,
npm ERR! stack:
npm ERR! ‘Error: EPERM: operation not permitted, unlink ‘D:\Code\PWA\PWA — Working Model\Angular Model\angularpwa\node_modules\.staging\typescript-33007fc3\lib\tsserverlibrary.js»,
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘unlink’,
npm ERR! path:
npm ERR! ‘D:\Code\PWA\PWA — Working Model\Angular Model\angularpwa\node_modules\.staging\typescript-33007fc3\lib\tsserverlibrary.js’,
npm ERR! parent: ‘angularpwa’ >
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It’s possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm WARN tar ENOENT: no such file or directory, open ‘D:\Code\PWA\PWA — Working Model\Angular Model\angularpwa\node_modules.staging@angular\common-6157584c\upgrade\package.json’
npm WARN tar ENOENT: no such file or directory, open ‘D:\Code\PWA\PWA — Working Model\Angular Model\angularpwa\node_modules.staging@angular\common-6157584c\upgrade\upgrade.d.ts’
npm WARN tar ENOENT: no such file or directory, open ‘D:\Code\PWA\PWA — Working Model\Angular Model\angularpwa\node_modules.staging@angular\common-6157584c\upgrade\upgrade.metadata.json’`
I tried deleting node_modules, doing npm i again, clear npm-cache by force.
Still getting same issue
danny-p93 commented Oct 23, 2019
Close the vs code and go to directory via terminal and install npm from the terminal.
this worked for me aswell
I had the same issue, after i transferred the dependencie-property of one project to another and executed npm i in the new Folder and it broke after some seconds.
My guess is that in my special case it is related with WSL.
I startet working with VScode on Windows, recently enabled WSL and installed the Ubuntu 18.04 App. Within that app i installed Node for Linux and made some other configs to run that WSL-Ubuntu properly on my System. Then i found the WSL-Remote Extension for VScode. After that i was able to run a Linux terminal in my Windows-VScode, start node, use git (without git bash) and everything.
Just the npm i didn’t work in VScode (aswell as in the Ubuntu app). After i closed VScode and run npm i in the WSL app again eveything worked fine.