Windows Fall Creator - can't install using node npm - node.js

After installing Windows Fall Creator version 1709 I cannot install anything using npm. I've tried uninstalling and reinstalling node. It appears to be a permissions issue. Whenever I try I get
ENOENT
o -4058
all rename
nt ENOENT:
I've tried running using Windows bash and it too errors out with nearly the same message. Any ideas?

Webroot Secure anywhere was broken with Fall Creators and prevented node from running.
See https://community.webroot.com/t5/Product-Releases/Windows-10-Fall-Creator-Update-Bug-Fix/td-p/305469

If it worked before the Fall Creators update, you might just need to update npm and try whatever you wanted to do again.
npm i -g npm
Another thing you might want to try is clearing your package cache with the following command, that sometimes can cause issues on Windows too.
npm cache clear
// or optionally even
npm cache clear -f

Related

How to resolve (reading 'isServer') error in npm?

Catch this error after npm i. Version npm - 8.0.0, nodejs - 16.11.0.
npm ERR! Cannot read properties of undefined (reading 'isServer')
I had the same issue with close versions of node and npm. I was using a shared connection from my phone since I wasn't home. When I get back home and used my WiFi things got back to normal.
If you are using such kind of connection then it is probably that causes this issue.
Try to use npm with specific version
for example i was trying to use npm install -g truffle and it did not work
but this one work npm install -g truffle#5.0.5
I updated npm and that fixed it!
You can update npm like so:
npm install -g npm#latest
If running this command doesn't work then you can try installing npm packages in an Admin Environment.
Hope this helps!
The issue could be due to the network, try to change the network and retry. This solved my issue :)
I've got the same issue, then I updated npm to 8.3.0, and the problem is solved.
Copying the npmrc.5 file from:
C:\Program Files\nodejs\node_modules\npm\man\man5 to C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm seemed to work for me:
Copy-Item -Path C:\Program Files\nodejs\node_modules\npm\man\man5 -Destination C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm –Passthru
Try stable Nodejs version 14.16.1 instead of 16.
Nodejs 14.16.1 Link
Update the latest version of Node.js. Then try to install npm the issue won't come.
Check out this URL https://nodejs.org/en/
and install a version recommended for most users.
I had this same issue, turning off all port forwarding on my router helped.
Whenever, I saw this problem. I restarted the computer and it working immediately.
I recommend trying this solution.
Based on what I've read on issues related, it seems like there's conflicting global packages and node versions.
Please try uninstalling both node and npm and try again.
Check out these issues for more details:
Node error Cannot read property 'resolve' of undefined
Cannot read property 'resolve' of undefined when using npm to install a package
I had the same issue and tried all the possible solutions. None of them worked.
And finally, when I restarted my PC, it worked like a charm :).
It happened to me because of the node.js version and an npm update.
Uninstall nodejs
Delete folder C:\Users\Administrator\AppData\Roaming\npm
Install nodejs (v17.x)
In your project folder:
npm install -g npm#8.3.2
npm i --package-lock-only
npm audit fix --force
It worked for me. I hope it helps you :)
When I had this problem, I was trying to deploy my NodeJs server in Heroku. The problem was I forgot to load the enviroment variables manually, so it was related to the connection to the DB, that was failing.
It happened also locally for the same reason and it was still related to the failing connection to the DB.
I kept running into this problem in different scenarios. I found that because I had used a VPN during my computer session, but not during the time I ran 'npm install', it was throwing this error. I simply reinstalled and restarted and did not enable my VPN during that session. Although, you may not have to completely reinstall-- only restart you PC without using a VPN after restart-- I do not know as I have not tried.
(Specifically I was using Express VPN)
Update: I ran into the problem again immediately after a fresh install and restart. Again I restarted my computer (without a fresh install as I had just reinstalled it.) This seemed to work for the moment. Will update with any permanent fixes I come across.

npm does not support Node.js v12.18.3

Can see it's been asked a dozen times but none of the solutions I've found have worked for me so far.
I've installed the latest version of Node.js (12.18.3) on my Windows 10 PC and I'm trying to install a package using npm. When I input npm -v it comes back with 5.6.0, which to me looks out of date - but when I try and install a package or update npm, I get the following error every time:
npm WARN npm npm does not support Node.js v12.18.3
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in:
I've tried uninstalling Node.js completely, deleting all node_modules folders and restarting my computer after a fresh install, but it's the same thing each time. I've also tried using npm install -g npm and npm install npm#latest -g but again, I get the same error.
Any solutions here?
I found the work-around !
First you need to open your cmd line, and use " npm install -g npm#latest "
you'll get the error like this
C:\Users\KimeruLenovo>npm install -g npm#latest
npm WARN npm npm does not support Node.js v14.7.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! cb.apply is not a function npm ERR! A complete log of this
run can be found in: npm ERR!
C:\Users\KimeruLenovo\AppData\Roaming\npm-cache\_logs\2020-08 10T09_36_56_388Z-debug.log
Go to the path where you can find the debug log( this file is found in your npm-cache folder)
C:\Users\KimeruLenovo\AppData\Roaming
Delete the NPM and NPM-Cache folder, but DO NOT reinstall node .
once deleted go back to your comand line and re-use the command
" npm install -g npm#latest "
This should do the trick :)
I also had the same issue, Windows 10 with npm v6.4.1 and trying to upgrade node from v9 to v12.18.3.
The problem seemed to be that whenever I tried to install the latest version of node, npm wasn't upgraded and npm v6.4.1 only supported node up until v11 (even though the download page says "Latest LTS Version: 12.18.3 (includes npm 6.14.6)": https://nodejs.org/en/download/).
This Github issue led me to the solution, which was to uninstall node (Settings -> Add or remove programs), then navigate to C:\Users\{User}\AppData\Roaming and delete the npm and npm-chache folder and finally install node again (using the installer).
The problem on my end was arising because I was using NVM yet I had already previously installed NPM independently.
All I did to solve the issue was delete the npm and npm-cache folder located here:
C:\Users\your-username\AppData\Roaming. No need of doing a fresh npm install (just leave that to NVM)
I had the same problem. Delete node and npm cache in AppData folder inside C: drive and install recommended version on another drive.
Go to the path where you can find the debug log (this file is found in your npm-cache folder) C:\Users\yourname\AppData\Roaming
Delete the NPM and NPM-Cache folder, but DO NOT reinstall node. Once deleted go back to your command line and re-use the command " npm install -g npm#latest "
I had same issue.
I tried to install node with choco install -y nodejs.install.
then, npm i works fine.
(before that, nodist was uninstalled)
I used nodist to install node. it may be the cause I think.
I have the same problem even after reinstalling Visual Studio. Cleared caching, and the weird thing, the Node.Js which is installed is the lastest (12.18.3)
So far i've found the node modules of the npm package, in the troubleshooting file they were accuring this solution
"
You can check your npm version by running npm -v.
Steps to Fix
Upgrading on *nix (OSX, Linux, etc.)
(You may need to prefix these commands with sudo, especially on Linux, or OS X if you installed Node using its default installer.)
You can upgrade to the latest version of npm using:
npm install -g npm#latest
Or upgrade to the most recent LTS release:
npm install -g npm#lts
Upgrading on Windows
We have a detailed guide for upgrading on windows on our wiki.
Proxy and Networking Issues
npm might not be able to connect to the registry for various reasons. Perhaps your machine is behind a firewall that needs to be opened, or you require a corporate proxy to access the npm registry. This issue can manifest in a wide number of different ways. Usually, strange network errors are an instance of this specific problem.
Sometimes, users may have install failures due to Git/Github access issues. Git/GitHub access is separate from npm registry access. For users in some locations (India in particular), problems installing packages may be due to connectivity problems reaching GitHub and not the npm registry.
If you believe your network is configured and working correctly, and you're still having problems installing, please let the registry team know you're having trouble.
Steps to Fix
Make sure you have a working internet connection. Can you reach https://registry.npmjs.org? Can you reach other sites? If other sites are unreachable, this is not a problem with npm.
Check http://status.npmjs.org/ for any potential current service outages.
If your company has a process for domain whitelisting for developers, make sure https://registry.npmjs.org is a whitelisted domain.
If you're in China, consider using https://npm.taobao.org/ as a registry, which sits behind the Firewall.
On Windows, npm does not access proxies configured at the system level, so you need to configure them manually in order for npm to access them. Make sure you have added the appropriate proxy configuration to .npmrc.
If you already have a proxy configured, it might be configured incorrectly or use the wrong credentials. Verify your credentials, test the specific credentials with a separate application.
The proxy itself, on the server, might also have a configuration error. In this case, you'll need to work with your system administrator to verify that the proxy, and HTTPS, are configured correctly. You may test it by running regular HTTPS requests.
"
I'll try to work on it and keep you informed if i'm able to solve this problem
Go to the path where you can find the debug log( this file is found in your npm-cache folder) C:\Users\KimeruLenovo\AppData\Roaming
Delete the NPM and NPM-Cache folder, but DO NOT reinstall node . once deleted go back to your comand line and re-use the command " npm install -g npm#latest "
This should do the trick :)
As mentioned earlier, is that I deleted these folders before installing the new version and also worked.
Start by uninstalling the node js by running npm uninstall -g npm, you will fall back to the previous version of Node.js
Just install what is required from the official site of Node.js https://nodejs.org/en/
No SO version or command lines required
If none of these solutions work which happened to me just go to https://nodejs.org/en/ and download the recommended version manually super fast!
Use n.
I am so glad discovered this package.
if npm installed;
npm install -g n
n lts
for other ways or more details;
https://www.npmjs.com/package/n
My specific case required that I use node 12.14 and I was getting this error.I tried installing the npm version but still was getting this issue
I was using NVM, so I uninstalled all other versions of node using
nvm uninstall 18 And like this all other versions
Before uninstalling the last version, I was getting some error so I ran
nvm deactivate
After which I uninstalled the last remaining node version too
I uninstalled the npm after that, and installed just the node version I needed using NVM
nvm install 12.14
and it installed the required npm too, with it my problem was solved. Hope this would be of use to someone

How to resolve rename error during npm install

I opened the cmd window as administrator and ran npm install on a folder, got this error at one point:
npm ERR! Error: EPERM: operation not permitted, rename 'MyFolder\node_modules\.staging\#angular\common-54da66e9' -> 'MyFolder\node_modules\#angular\common'
npm ERR! at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
Same seems to work on other machines!
Can someone help me fix this?
I had this problem recently at my work place. In my case what I was doing was, I had the project open in the editor(I use VScode, which is cool:)) and then in the cmd window I was trying to run npm install on the same project folder. I got the same error no matter what I did.
The thing that solved the issue for me is, whenever I try to do npm install I close the editor window in which the project is opened and then run npm install from the cmd window. This works without any issues for me.
By the way I have observed that this is only with windows I guess, on my mac I have never encountered this issue.
After running "npm cache clean", deleting the node_modules folder in the project and then running "npm install" again, fixed this!
working under windows 10 I opened the CMD as an administrator and that fixed my issue.
Use yarn instead of npm. So yarn install should replace npm install.
I was on npm 6.14.5 where it didn't work. It works with yarn 1.22.0.
I believe the problem is some race condition and my guess would be that it is because the Windows filesystem is much slower than the Linux file system, especially if you access the Windows file system through the Linux WSL (so if you access the files under /mnt/c/... ). So somewhere in the execution of npm it deletes files and later in the program it assumes the deletion is complete and that might not always be the case, hence the error.
This question is probably long dead, but if you are using VS Code you can simply open a terminal in VS Code where you want run npm install and it works without issues. Running your app in a terminal outside of VS Code is what causes this, as there is some conflict with having the project folders open in VS Code at the same time. As a general rule, I use the terminal in VS Code for npm install, nodemon, etc. and then run my application in an outside terminal.
I get this sometimes on macOS with current npm version (6.4.1). The way I got it working is by reverting changes to package-lock.json. Basically I just do git checkout package-lock.json, and then npm install works as it should
For me, the problem was that OneDrive was trying to sync the directory I was in. Once I moved the directory to a location that OneDrive does not sync, I was able to run npm install with no errors.
For me the issue was OneDrive sync service. That service was using my folder to upload on server. When I was running npm build command I was getting the error as node couldn't rename the required file as it was already in used by OneDrive. I disabled the service and it worked for me. Hope it helps.
As, one of the answer above says to delete node_module that would take a lot of time if the project is large enough and have many modules, rather than that try npm uninstall then delete the package-json (to avoid any conflict while reinstalling the modules). After that npm install . This worked fine for me.

NPM was installed. I attempt to update and find it's no longer installed

I installed Node on El Capitan using the package from their website.
I check to see if npm is installed and it shows version 2.15.5 is installed.
I then routinely check to see if there's an update and accidentally forget to use sudo. I retry again using sudo and it fails saying npm command isn't found.
Both which npm and whereis npm fail to return anything.
What's going on?
Well, your npm upgrade failed, which means that either:
the symlink /usr/local/bin/npm that pointed to the actual script was removed, but it failed when trying to remove the actual npm files and hence, never reinstalled a new symlink
the /usr/local/lib/node_modules/npm stuff actually got removed, but not the folder, hence the upgrade failed.
npm should point like this from /usr/local/bin:
npm -> ../lib/node_modules/npm/bin/npm-cli.js
Hope that helps. If the actual npm-cli.js file is actually gone, your best bet is to just re-install node and then upgrade with sudo.

npm hangs on postinstall / unlock

I have a Linux server that runs some virtual Machines using KVM. Host machine is a Debian derivate with kernel 2.6.32-32(-pve).
In roughly 75% of the times I run npm install, it hangs while installing modules. I ran it in silly debug level and it always hangs at the line
npm info postinstall [module name] (older npm versions)
or
npm verb unlock done using [...] (newer npm versions)
forever.
It happens in every project on the host machine and on the virtualized systems for every node and every npm version I have tested (a lot, including the newest ones (2.7.x atm)).
It also is not deterministic. Sometimes it works, sometimes not and most of the times it hangs on a different module.
On my dev machine (which is in the same network, running OS X 10.10) it works fine.
I am not behind any kind of proxy.
What could possibly be wrong here?
EDIT: For the time being I solved this problem by checking in all my dependencies as gzipped files using https://github.com/JamieMason/shrinkpack
I was having the same issue for several hours, and couldn't work out what the problem was. I tried re-installing everything a few times, manually installing individual modules, switching from x64 to x86 versions of NodeJS, etc, and got nowhere.
In the end, I changed networks, from WiFi over ADSL2+ [~2mbps] to 4G Hotspot [~20mbps] and it worked in 30 seconds. No idea why, since it didn't seem like a network speed issue, but it solved the problem.
Hope this helps someone else, too!
I had the same problem on our Jenkins slaves based on Ubuntu, and it was solved by upgrading npm.
Default npm installed by apt-get has version 1.3.10 now, which is very old (shown by npm --version). There are at least two ways to upgrade it:
Run sudo npm install -g npm command. If you want to install a specific version you can run append it at the end of command: sudo npm install -g npm#2.1.3.
Or you could add NodeSource repositories using these instructions and run usual sudo apt-get update.
I have the same problem on Windows. I deleted my npm-cache folder and reinstalled npm. Everything started working normally after that.
The npm-cache folder can be found at
<your-drive>\Users\<your-name>\AppData\Roaming\npm-cache
Remember to turn on 'View hidden files because the AppData folder by default is hidden
You can reinstall npm by using the command,
npm i npm -g
On Windows make sure you are in a native CMD (not in VSCODE or whatever IDE). Also, try increasing the max memory limit for node:
set NODE_OPTIONS=--max_old_space_size=8096
I did the same, switched my network from WiFi to 3G and it worked.
I'm experiencing the same problem, this is the issue on Github:
https://github.com/npm/npm/issues/7862
There are some useful tips that seemed to help a few people.
For me doing $ npm install -g node-gyp (as suggested here: http://gangmax.me/blog/2013/05/13/resolve-npm-update-node-gyp-hung-problem/) fixed the problem.
I had the same problem and just run
npm cache clean
And it works!
Had this same problem in Windows. The solution was to restart after installing node and npm and then run command prompt as administrator.
In my case, a system restart did the work.
I ran npm install --verbose which suggested some lock on a file in npm-cache. And I think the system released the file (which was under use) after the system restart. I am using windows.
Try cloning the project again and then run npm install to install the packages in your terminal.
I ran into this with npm v6, and it turned out I was just being impatient. I just needed to wait a little longer and it proceeded to the next step.
npm cache clean --force
works for me :)
=> this method working with me When npm block in installation Package for IONIC installation and ReactNative and another package npm.
you can change temporary :
npm config set prefix C:\Users[username]\AppData\Roaming\npm\node_modules2
change the Path in Environment Variables set C:\Users[username]\AppData\Roaming\npm\node_modules2
Run the your command to install your package .
open file explorer copy the link C:\Users[username]\AppData\Roaming\npm\node_modules
ok file yourpackage.CMD created another folder Created "node_modules2" in node_modules and contain your package folder.
copy your package file CMD to parent folder "npm"
copy your package folder to parent folder "node_modules"
now run npm config set prefix C:\Users[username]\AppData\Roaming\npm
change the Path in Environment Variables set C:\Users[username]\AppData\Roaming\npm
now package working correctly with Command line

Resources