It turns out, that it has nothing to do with permissions, cache, etc. For node v 6.x you will see more detailed error stack but not after 7.x For me and my colleges, the issue is timeout function. Basically the package install has not finished yet (i.e. holding the directory) when npm tries to delete it. In node 6.x you can see that in finalize.js now it's gone! Was running 'npm update', EPERM error using Visual Studio 2022 and Git. Had to remove read-only attribute from node_modules folders and children and also from the package-lock.json file.
Npm install (6.1.0) doesn't update package-lock.json when using Git URL as dependency. In our team, devs are using npm i while devops are using npm ci, so that the application behaves quite differently during the deliver cycle due to inconsistent lock packages. This issue doesn't exist in npm 5.7.0 and below. Actually, the error in this article has a relation with the previous article. The article has a title of 'How to Solve Error Message no such file or directory, open 'package.json' in NodeJS' in this link.
The answer is just use a normal physical storage. Briefly, the above error appear when the execution of the command exist in a mounted folder. Furthermore, the mounted folder actually exist physically in a host machine running using Windows operating system. Apparently, executing the command in a guest machine running using Linux CentOS 8 in a virtual server end up failing.
So, there is a certain permission aspect blocking the execution command in a mounted folder where it exist physically in the host machine running using Windows operating system. Read Only for me though the original issue was that I usually just use code to install. In this one case I opened a new instance of the app in Visual Studio so I could port some changes from an old version and VS promptly started installing itself.
I then opened code to run npm install as I would normally and both apps got into a tizzy. After several fails I then mass dropped a node-modules from a working root version of our app to allow me to back port the changes. This folder was read-only so then carried on blocking things.
Clean project with some deps in package.json. You run npm imodules are installed and package-lock.json file is created. Say you update module A in package.json file. I would expect this updates the package-lock.json file but it doesn't. Which results in module A not being updated.
By running sudo npm under a non-root user , filesystem permissions are being heavily modified. It appears that the ownership is recursively changed to the user currently running npm. I'm using npm 2.7.4 with nodejs v0.12.2 on Windows 7x64 and I'm running into an odd issue.
With the below package.json, when running npm install the process will hang after it runs node-gyp for ws for karma. But if I run npm install -ddd then it doesn't hang and installs correctly. Most likely the node_modules folder became Read Only. You can try updating folder permissions but if you do not have admin access, the npm install --force will work. By my reading, npm v6 sounds like a big improvement in speed and reliability but this particular weakness is a total showstopper for moving back from yarn. Other programs scanning node_modules, such as anti-virus or VSCode or Atom Editor are locking up these files and causing very long-running npm operations to fail completely.
Yarn, in comparison, does not suffer these failures. Disabling antivirus, even selectively on node_modules, is arguably foolish, maybe even disallowed in some environments and certainly obnoxious. Quitting the editor, especially considering the integrated terminal of VSCode, is ridiculous.
I was on a Windows machine the other day and couldn't delete a file. Tried using the command line as admin and various applications. It made me think about why I prefer Mac over windows, one of the reasons being that I have complete control over the OS. Guess Apple is now deciding that after almost 20 years of macs running OS X that users shouldn't have access to one of the core features- the unix/bsd base system.
Deleting the package-lock.json in the server directory allows npm install to finish without errors, but is obviously not practical for daily use. The issue I have isn't the Terminal getting that message; but the Finder, when manually copying files from one tab to another in the same Finder Window. If in two separate windows, it works; but when the Dock PreferencePane's "Prefer tabs when opening documents" is set as Always, I get the error. Anyone experience this and any solutions? I could in theory add the Finder.app found in /System/Library/CoreServices; but this is a very risky kludge and not a valid solution. This was my problem, I rimraff'd a node_modules folder through the terminal on VS Code - for some reason it didn't quite remove the node_modules from my file system and had it locked.
Wasn't until I closed out that window of VS Code and opened it back up that it actually got removed and I could run npm install again. In my case I had to run it as normal user and it worked, it appears to be user permissions conflict. But it seems all other solutions given here npm clean, npm install are not required. If more people can confirm, I can post a new answer.
I could use npm install && npm test && npm install && npm test, but that is very significantly slower than running my entire test suite. In addition, this wrecks any chance of receiving proper code coverage reports. Obviously, I have code that conditionally applies to one or another version, and no code coverage tool understands that, if I need to run npm test twice . I'm able to reproduce this on another machine (same setup, node, Win7x64, but doesn't have python, etc. setup for node-gyp) and it happens when using io.js v1.6.3 as well. Since it does install when changing logging settings in npm, I've opened the issue against npm, let me know if it belongs elsewhere.
Please let me know if you need anymore information. Updating package.json with dependency @angular/compiler-cli @ "11.0.0-next.2" (was "10.1.2")... Updating package.json with dependency @angular/cli @ "11.0.0-next.2" (was "10.1.2")... Updating package.json with dependency @angular/compiler-cli @ "11.0.0" (was "11.0.0-next.2")... Updating package.json with dependency @angular/cli @ "11.0.0" (was "11.0.0-next.2")... Obviously this type of error message makes navigating and using the command line in MacOS Mojave to be quite difficult if not impossible for many purposes.
Don't worry, the Terminal is not broken in new MacOS versions. Doing same thing with NPM does not set read-only to files. Another problem I have I install the package and on postinstall step it sets chmod some-file 400, and while some operations yarn fail with a like error on this file, . In my case it happened when I had a git conflict in package-lock.json and tried to run npm install.
My answer is to do npm cache clean --forcefirst. Then run npm install -g install npm 5.3.0 version. For me, this npm version works with no trouble. My answer is to do npm cache clean --force first. Then run npm install -g to install npm 5.3.0 version.
After that no need anymore to use sudo for npm commands as the metadata keeps windows and linux file/directory permissions in check. For me, I had another node process running, json-server in my case. Once I stopped that the package installed without error. Thanks @kamil.ka this was my issue on Windows. Atom was locking the package.json so npm install couldn't change it. I found that a selection of directories in / were owned by a non-root user after running sudo npm and many binaries in /usr/bin stopped working as their permissions were changed.
People experiencing this bug will likely have to fully reinstall their system due to this update. This issue has been happening ever since 5.7.0 was released a few hours ago. It seems to have completely broken my filesystem permissions and caused me to have to manually fix the permissions of critical files and folders. I believe that it is related to the commit 94227e1 which is traversing and running chown on the wrong, often critical, filesystem files and folders. When doing an npm install with just a package.json, I get an EPERM which causes an error and installation aborts. Updating package.json with dependency @angular/router @ "11.0.0-next.2" (was "10.1.2")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "11.0.0-next.2" (was "10.1.2")... Updating package.json with dependency @angular/platform-browser @ "11.0.0-next.2" (was "10.1.2")... Updating package.json with dependency @angular/forms @ "11.0.0-next.2" (was "10.1.2")... Updating package.json with dependency @angular/core @ "11.0.0-next.2" (was "10.1.2")... Updating package.json with dependency @angular/compiler @ "11.0.0-next.2" (was "10.1.2")...
Updating package.json with dependency @angular/common @ "11.0.0-next.2" (was "10.1.2")... Updating package.json with dependency @angular/animations @ "11.0.0-next.2" (was "10.1.2")... Updating package.json with dependency @angular/language-service @ "11.0.0-next.2" (was "10.1.2")... Updating package.json with dependency @angular/router @ "11.0.0" (was "11.0.0-next.2")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "11.0.0" (was "11.0.0-next.2")... Updating package.json with dependency @angular/platform-browser @ "11.0.0" (was "11.0.0-next.2")... Updating package.json with dependency @angular/forms @ "11.0.0" (was "11.0.0-next.2")...
Updating package.json with dependency @angular/core @ "11.0.0" (was "11.0.0-next.2")... Updating package.json with dependency @angular/compiler @ "11.0.0" (was "11.0.0-next.2")... Updating package.json with dependency @angular/common @ "11.0.0" (was "11.0.0-next.2")...
Updating package.json with dependency @angular/animations @ "11.0.0" (was "11.0.0-next.2")... Updating package.json with dependency @angular/language-service @ "11.0.0" (was "11.0.0-next.2")... It was also monitored by the anti-virus scanner, in this case McAfee, and those folders were not on any scanning exclusion lists. The npm install step in my Teamcity CI build for an angular app I have been working has been failing intermittently and I finally uncovered the reason. Along the same lines as others talking about read only on node_modules folder and closing down VS to run npm install over.
I've gotten this issue in the past when the project folder I'm operating on is within Dropbox. Particularly after running generate commands which suddenly produce a lot of files, it seems like Dropbox's syncing code locks up files and prevents NPM from renaming as necessary. Npm install with local packages and symlinks - ENOENT ... Please notice that the package-lock.json wasn't updated even though the dependency has a new commit, however, node index.js still somehow uses the latest code from dependency. We'll still keep shipping an OSS reference implementation, but it probably won't do private modules, since that usually is going to require some kind of custom logic. Basically, npm-registry-couchapp will be just a part of the registry implementation, instead of effectively the entire thing.
In addition, there'll be a minimal "front door" bit that proxies to the Couch App, manages roles, restricts GETs, etc., and that's where you'll find hooks for auth magic. Here I'm trying to install lodash; and repl.js is my own package, installed as git-repo. So, when I have any git repositories in ~/node_modules they prevent me from installing any other ordinary package. Recently, I've faced different issues when tryng npm install in some of the project I've been working with.
Granting apps full disk access has potential for problems, with Terminal it makes sense if you are a terminal user but for others it's not a good idea to randomly add apps to that list. This is a protection mechanism in new macOS. A quick tutorial on how to get past an issue when running npm install with McAfee fighting for control.
Those threads don't relate to the specific error message I am getting. This error message prevents any downloads using video downloadhelper. I removed both firefox and video downloadhelper and reinstalled but the problem remained, hence my post here. The combination of network location and McAfee scanning disagreed with node.js and npm meaning that files would appear locked or missing and often generate the not permitted error.
Doing a npm install phantomjs on a Win7 machine is giving me the error below. Looks like everything works up until the very end. It seems to be the Node.js issue isaacs/node-graceful-fs#104 That would explain that such weird workaround as same for Dropbox, paused syncing fixed the issue... Prevents issue happening, because probably there is no high concurrent access to the same files anymore after stopping file system scanning by Dropbox . Open the command prompt as administrator and navigate to the project location and then run npm install.
I didn't find this anywhere but it hit me that our VMs tend to change files to a read-only state. So I opened package.json's file properties and deselected Read-only in the "General" tab. Not package.json, but for whatever reason, my node_modules/ had become read-only. The error appeared again, but now the error message is self explanatory. It saying that the shell-init cannot access parent directories, and this is because error retrieving current directory.
A lot of ENOENTS for files not being found while doing npm install. If you use basically any private system, you'll end up with name conflicts. Let's say our company creates a module called marked, to track places that we've marked in our location tracker app. You can update the addition packages by running the update command of your package manager. This can happen more easily with the most recent change of the default shell from bash to zee-shell with macOS 10.15 Catalina. Previously, accessing a folder without permission would bring up a popup that explicitly asks for the permission.