NPM command (on Windows 10) returns no result - node.js

As you saw in the title the command npm does not return anything (as in returning to input again) but is a registered command on Powershell. I have tried removing all nodejs and npm folders and retrying installing it with utilities like nvm, but none of them seem to work. As far as I have checked there is no log output.

Never mind. I found out what was wrong, my CMD was being blocked by a registry key, deleted that and it worked. Thank you!

Related

When I try to execute 'npx create-next-app', the installation never ends

I'm trying to create a new NextJS app, but the command npx create-next-app <name> never ends. It installs a few files along the way (including node_modules/), then after a while, among all the great lines that a CMD shows, it displays an installation line that never ends. When I try to cancel the installation, I must restart my PC completely.
Note: the last line is always beginning with "reify:something: timing ... Completed in Xms"
My problem
I've tried to reinstall NodeJS, It did not change a single thing.
I've tried to delete the cache, nothing changed.
I have used npm in the past and it always worked fine, I have absolutely no idea why it doesn't work now.
Please help me, I don't know what to do, except to throw my PC out the window.
I'm on Windows 10, using npm 7.24.1 with node v14.17.6
Finally, I fixed my problem thanks to Marcel Herd: I installed WSL 2 and from now on I'll use Ubuntu on Windows to execute npm commands.
However, I have still no idea why I had to do such a thing...
Thank you
If you are interested, here are links that helped me:
https://learn.microsoft.com/en-us/windows/wsl/install
https://learn.microsoft.com/en-us/windows/wsl/setup/environment
https://learn.microsoft.com/fr-fr/windows/dev-environment/javascript/nodejs-on-wsl

NPM command config is broken

I edited npm config set <key> <value> and messed up.
Now whenever I try running anything that remotely starts with npm config, I'm getting an issue that looks like that:
Error: Failed parsing JSON config key
How can I reset my npm config or find the file to manually delete my changes?
I have tried reinstalling npm and nvm several times.
Accepted answer
Was technically correct, I also realized that I was missing a second question (ie how to find invisible files athe mac). I'm on a mac and .npmrc is a hidden file (which can be toggled with cmd+shift+.) But all in all, it worked out, thanks yall!
Try editing the config file directly: ~/.npmrc
https://npm.github.io/installation-setup-docs/customizing/the-npmrc-file.html

Node isn't recognized

Referring to the above picture, can someone please tell my why my NPM script would continually fail saying that node is not recognized.
nodejs is clearly in my $PATH and it correctly identifies where it is on my computer outside of an npm script.
I am using Git Bash inside ConEMU on Windows Version 10.0.17134 Build 17134.
I wouldn't be surprised if the issue is with Windows, as the problem seems to have popped up since the latest OS update, installed just over a week ago (I've been having this issue for around that same amount of time)
I have finally got it working! It is, unsurprisingly, a Windows issue.. Because I had a few entries in my $PATH, and the nodejs one was at the end, Windows would silently fail when reading the entire path, and not get as far as the nodejs entry. The fix was to move the nodejs in the Environment Variables control panel to the very top

NPM commands 'Aborted' if I don't run as root.

I've run into what I think is a fairly new problem - I'm running npm on my production machine and it only runs when I'm logged in as root. Otherwise, it just exits saying "Aborted". The only command I can give is npm -v which prints out 4.2.0
It seems like a permissions issue (one answer for which was to delete and re-install everything with NVM) but I hadn't seen anyone else reporting this issue of the command just exiting with "Aborted", so I wanted to see if there was something else going on before doing anything drastic.
Let me know if I can provide any additional context! Thanks, all!

npm error on every command: EEXIST: file already exists, mkdir 'c:\users\user\appdata\Roaming\npm'

I'm just new to node and npm and this is frustrating.
Well it's almost all said in the title.
On a Windows 10 x64 using a NON elevated prompt, all npm commands shows:
EEXIST: file already exists, mkdir 'c:\Users\Josep\AppData\Roaming\npm'
at Error (native)
Even npm -v shows it twice before the version number.
Not hapening in an elevated prompt. version numbers differ in an elevated and a user prompt.
Double checked PATH variable. Same on two cmd windows.
Node version 6.10.0
NPM Versions: 4.3.0 at elevated prompt and 3.10.10 at a user prompt.
For me, just adding --force solved it.
I had similar issue, solved it by removing .npmrc file, located at c:\Users\<USER>\ location.
I believe it was caused by running earlier npm config set in wrong location.
Kudos to this comments thread.
In my case remove white space from folder name.
Try reinstalling node and npm for the non-admin account. If that's not an option, you can use the portable version:
Download from http://nodejs.org/dist/
Extract the archive.
Open cmd and cd to the extracted folder.
Run nodevars.bat.
It will set PATH and other things so you can now use node from this folder.
I also had this problem. Just delete npm folder, it will be created again. This problem is due to user privileges.
this is because you have same file in node_modules/Cypress/bin and node_modules/.bin, which is cypress(type=file).
Remove cypress(type=file) from node_modules/.bin, this will resolve the issue.
it happened to me, I had a space in my folders path C:\Users\Jhon Doe, should be C:\Users\JhonDoe.
Microsoft has a bit more information about how this can happen: https://learn.microsoft.com/en-US/troubleshoot/windows-client/user-profiles-and-logon/renaming-user-account-not-change-profile-path
For me, cd ios && pod install && cd .. fixed it.
I had the same issue and was able to resolve it on Windows by running the cmd prompt as Admin.
Go to the folder where you have installed Cypress. For example D:\cypressautomation --> then go to "node_modules" --> and then ".bin" folder. Here in this folder, if there is any file named "cypress", then just delete it (before deleting I think cypress needs to be closed). Reopen the cypress. This worked perfectly fine for me.
In my case. edid like below
※one more, check white space from folder name.

Resources