-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm commands are not working #3882
Comments
Thanks for replying. I've skimmed through them, but couldn't really catch a solution & I'm afraid to mess with my current environment. Could you please guide me though one? |
|
That didn't work for me. |
In any event, I don't know the steps you followed to get into the state (starting with installing nodejs on Windows). So I can't give you specific steps to undo the state.
|
|
When I run the path command, the |
Then you don't have
Which is like |
install newest version of nodejs like below curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - then you can use /usr/bin/npm instead of npm |
this worked for me |
I fixed my npm doing:
You need restart visual studio code if you are using embed terminal. |
This worked for me. How did this exactly work? Sorry I am just a beginner. |
It took all the Windows paths out of |
There's an alternative. |
I had the same issue and was wondering if there is an actual solution for this. Does it make sense to install npm again? I thought the whole point would be to use the existing installation so it doesn't make sense to unmount C, change PATH and do other npm install |
Windows You can summarily ignore the The "actual solution" is to ensure you have all the [The suggestion to launder the Windows components out of |
exactly what i was looking for! thanks! |
This also worked for me |
@therealkenc @bterlson Please Anyone tell me how to undo this i tried and how i'm having problems |
Ran into this wsl npm headache today. If other solutions did not work for you, this is what I did.
1- Optional..UNINSTALL ubuntu wsl but don't forget to Run history first and back up your files.
Run this to update your terminal
11- which node Twitter is the best way to reach me. I think those are all the steps, but ping me @mabrafoo if needed. |
This worked for me
|
Thanks @Karlheinzniebuhr your solution worked for me |
I had this issue out of the blue after using npm with no problems on WSL for several months. Bizarrely, it fixed itself after a couple of hours with no intervention from me. Suggested alternative fix: wait and pray to the WSL gods? 😕 |
Easiest solution for me was just doing |
I was running Node 12 on WSL using NVM and run into the same issue as OP when trying to install Mongoose. I ran the "magic" command above |
You can entirely reverse the And to be clear: That The guidance to anyone landing in an I speak up because a lot of people struggling with There is some guidance on setting up |
Thank you so much man. You saved me a headache! |
it`s work me ! |
This worked for me. |
This works for me thanks a ton to help me out I just searched over n number of post to find the solution |
worked for me too. Thanks! |
All of the replies above seem to be installing First of all note that since the Windows 10 Creators Update (build 1703, April 2017), we can natively run The problem is that all of these are The way I go around this is by running:
You will notice that with your We must create alias for these again if you want to use them through Full solution:
The reason we need the After restarting your terminal, you should be able to run |
worked for me also! thanks. |
Thank you for the answer ! It really helped me. |
|
It worked for me Step 1. Inside WSL terminal sudo nano /etc/wsl.conf Add these lines: [interop]
appendWindowsPath = false Now close all the WSL terminals including those opened in VS Code. Step 2. Open Windows PowerShell as Administrator wsl --list
wslconfig /t Ubuntu-20.04 # your active version Step 3. Open WSL echo $PATH # it should include only linux paths
# check that node and npm do not mount to Windows paths
npm --version
# -bash: npm: command not found
node -v
# -bash: node: command not found
# now you can install node/npm inside WSL p.s. this guide has helped me |
This Worked for me Thanks |
One side effect which I had after doing this, is now I cannot directly run code. command to open my project in vscode from WSL terminal, a quick solution is to open vscode and from there open WSL window and then navigate to the desired folder, |
Update: code --remote wsl+distro name 'path in WSL' |
My Windows build number is:
Microsoft Windows [Version 10.0.17134.590]
I installed nodejs using this command:
sudo apt install nodejs
When I run node -v I get:
v8.10.0
, so apparently, it's properly installed, but when I run npm -v I get:Also FYI, when I run
which npm
I get:/mnt/c/Program Files/nodejs/npm
, but whne I runwhich node
I get/usr/bin/node
I have node installed on my windows to sometimes use it within Git bash.
What can I do to solve this issue?
The text was updated successfully, but these errors were encountered: