Related
I am trying to install the Vue CLI in ubuntu (WSL), but it doesn't seem to work for some reason. I ran the command yarn add global #vue/cli, and I also tried with npm install #vue/cli --global. The commands run as though they were successfull, but as soon as I run vue --version, it throws command vue not found. Any ideas?
Solved! (partly) after a lot of time, I went with the npm installation and it worked out of the box. To use yarn, add the following to your ~/.bashrc:
export PATH="$PATH:$(yarn global bin)"
I need help running localhost to connect with vs code. I am trying to open a phaser 3 game I built.
I have tried npm install -g
I keep getting permissions denied.
Could you try with sudo command(if you are using mac or ubuntu)
sudo npm install -g
If you are using windows, then open the terminal with admin rights. (Run as administrator)
After running npm install -g expo-cli and successfully installing the packages globally, expo is still not recognized as an internal or external command. Does anyone know how I might get around this issue using windows 10, or what to do in terms of something like a path variable.
Probably the only thing missing is to add the expo executable to your path.
For Windows 10, you can simply add the npm folder to your path environment variable.
Hit Windows key and search for Environment variables.
Inside the Path variable under System variables, add a new
entry (entries are separated by semicolons) with this content (without /node_modules ):
%USERPROFILE%\AppData\Roaming\npm
OR if you are using yarn C:\Users\{USER}\AppData\Local\Yarn\bin (as #Qwerty mentioned above)
Open a new command prompt and enter
> expo
You will see something like this:
I may be too late to answer this, but for people looking for the same error this is what worked for me.
Install yarn if you don't have it. I used the command choco install yarn (you'll have to install Chocolatey). If you have scoop installed, scoop install yarn also works.
Use yarn to install expo with yarn global add expo-cli.
expo start should work now. yarn start and npm start should also work.
Hope that helps!
I wondered it was working last night when I first installed and run the "react-native" project but the very next day it showed me the same error as yours.
Here is what I did in windows 10 Operating System:
Add the following path :
environment variable > System Variables > PATH > C:\Users\YOUR_USERNAME\AppData\Roaming\npm
Now I ran the following commands one by one in CMD:
i) npm -g uninstall expo-cli --save
ii) npm install -g expo-cli
Now start the Project and run npm start and now it works for me.
I didn't try this article one but it also shows the solution for the same problem,
see here
Added These path of npm like this i have the same issue i fix it by adding the path to environment system
C:\Users\abobakr\AppData\Roaming\npm
After that close CMD and open it again it should work believe me
go to the environment variable, then in the user variable section find Path and press the edit button, you will see a new window, press new and add the following
%USERPROFILE%\AppData\Roaming\npm
then press ok. Now,
expo --version
Here is the solution I came out with.
I ran npm list -g
then copy the directory on the first line and paste in your system enviroment variables under the variable name 'path'
close all the terminals and run expo or any other command.
This worked for me :
Download latest version of nodejs - https://nodejs.org/en/download/
After installing nodejs reboot your computer
install : npm install --global expo-cli
Generate a new project with - npx expo-cli init projectName
cd projectName
npm start
If it still doesnt work or you can't access npm. Try setting the path with the Windows PowerShell:
Open Windows Powershell as Administrator
Type: setx path "%path%;C:\Users\USERNAME\AppData\Roaming\npm"
It worked for me.
Re-install node.js and
then run npm install -g expo-cli in command prompt.
If you are using Windows 10 or 11, the solution to edit your Path variable works well.
Just make sure that you replace "YOUR_USERNAME" with your username on the computer:
This means that if my username is "Green", I will replace YOUR_USERNAME here:
C:\Users\YOUR_USERNAME\AppData\Roaming\npm
to
C:\Users\Green\AppData\Roaming\npm.
This article is very detailed in solving the problem in case if the above does not work for you.
I had the same problem last night, and I've recently started my journey in ReactNative. So, there might be better answers out there.
If you're following the ReactNative Official documentation, the first time npm start works fine, the subsequent ones throws an error saying expo is not recognized. I got around that by running expo start and not npm start ( which basically is the same thing but doesn't work for some reason ).
So, mine looks like a work around rather than an explanation as to why this happens or how to permanently fix it.
For me,
i uninstalled node.js,
i re-installed node.js,
i ran npm install -g expo-cli,
then ran expo --version (the expo command began to work).
Hope this helps.
This worked for me:
You must uninstall node js then install it again.
You must run npm install expo-cli.
It will solve your problem
This is a more general problem where your global node modules are not in your system path. This question is what you are looking for: Nodejs cannot find installed module on Windows?
I have fixed this in Windows 10 by setting Path C:\Users\[USERNAME] this line save my hrs
uninstall expo using this command
npm -g uninstall expo-cli --save
and reinstall expo using this command
npm install -g expo-cli
then it will work properly
I faced same problem and it was not getting resolved by "npm install --global expo-cli".
Global CLI was having error as SS below -
npm list -g --depth 0
Followed below steps to get it resolved
npm uninstall --global expo-cli
Deleted global package causing error C:\Users<USERNAME>\AppData\Roaming\npm\node_modules\expo-cli
npm install --global expo-cli
And expo cli worked.
Happy coding!!!
If you need a solution to Run Expo command without Environment Variable update then on your terminal use below command for windows system:
R:\> C:\Users\{user}\AppData\Roaming\npm\expo.cmd init {projectname}
Where you directly point the expo.cmd file rather than specifying in the environment variable.
And update the expo to C:\Users{user}\AppData\Roaming\npm\expo.cmd in package.json to run the project.
// package.json
"scripts": {
"start": "C:\\Users\\{user}\\AppData\\Roaming\\npm\\expo.cmd start",
"android": "C:\\Users\\{user}\\AppData\\Roaming\\npm\\expo.cmd start --android",
"ios": "C:\\Users\\{user}\\AppData\\Roaming\\npm\\expo.cmd start --ios",
"web": "C:\\Users\\{user}\\AppData\\Roaming\\npm\\expo.cmdstart --web",
"eject": "C:\\Users\\{user}\\AppData\\Roaming\\npm\\expo.cmd eject"
},
If you are using yarn global add expo-cli, try npm install -g expo-cli.
I don't know why but when i go into C:\Users\%{user}%\AppData\Roaming\npm there isn't the expo package(and other packages that I thought I install globally by yarn) but there are other that I installed globally by npm.
If adding C:\Users\%{user}%\AppData\Roaming\npm to PATH variable doesn't work, give this a shot.
If you set the environment path as said in other replies and the command is still not recognized, try running whatever you're using to execute the command in administrator mode.
I'm using VS Code terminal and expo was not recognized until I ran it as administartor.
Hi I'm running Ubuntu 16.04.3 LTS on Windows Subsystem Linux. I'm trying to run the Quick Start first app as listed in this section here https://electronjs.org/docs/tutorial/first-app however, I keep getting the same error no matter if I clone the repository, write it myself, or delete and reinstall the Electron module.
> electron .
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! first-electron#1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the first-electron#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
For reference I'm running
Node: 9.11.1
NPM: 5.8.0
Electron needs to open a chrome browser window. So, when you run it from WSL using a node.js that was installed in WSL, I guess it would try to start the chromium browser for Ubuntu, which will not work out of the box, because:
Microsoft doesn't support graphical programs on WSL. Bash on WSL is intended for running command-line programs that developers might need, but it's possible to run graphical Linux desktop programs on Windows using the Bash shell. To be more precise, you'll be able to display graphical programs running in WSL on a Windows 10 desktop by using an X server which runs on Windows 10.
https://virtualizationreview.com/articles/2017/02/08/graphical-programs-on-windows-subsystem-on-linux.aspx
I found the easiest way is to install electron on Windows then start it from WSL.
Steps:
Make sure you have Node.js & npm installed on your Windows machine (you can remove them afterwards)
Open cmd.exe, move to your project directory and run npm install electron --save-dev.
This will install the Windows version of the prebuilt Electron binary instead of the Linux one, which would occur if you try to install from WSL. (This is the actual trick)
Enter Bash on Ubuntu on Windows, move to your project directory then run ./node_modules/.bin/electron (or use an npm script) to launch your Electron app
Though, I'm not sure this is very convenient, it seems to work well.
I hope this will help people encoutering the same issue in the future!
Ref: https://github.com/electron-userland/electron-prebuilt/issues/260
run a X-server app in windows, then export DISPLAY , run the npm start.
When I try to install node-sass using npm, I get the following error message:
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":"
The command I use is:
npm install node-sass --save-dev-
You can see more details in the screenshot below:
After struggling , finally found exact solution.
In node js software folder, node-sass\4.5.0 folder is still created in npm-cache folder. So I download win32-x64-48_binding.node manually, put it in C:\Users\Administrator\AppData\Roaming\npm-cache\node-sass\4.5.0 folder.
And run npm install command, issue resolved.
I see you are running node version 8.1.4. You can also check it using node --version in the command prompt.
You'll have to use a version >= v4.5.3 instead because lower versions of node-sass are incompatible with node8. This issue has been reported on their GitHub issue page.
You either have to define using v4.5.3 instead or pass the the -g parameter while installing it, which seems to fetch the latest version automagically.
when i used -g it worked properly and got the latest version
Also, as #javiergarval has pointed out, you have a typo. It should have been --save-dev instead of --save-dev-.
My problem is, that I need an older node-sass Binary, which is not available for the new node version I have. But the solution is, at least on Windows, pretty simple. Just install the windows build tools. With that, npm is able to build the binaries out of the source.
Long story short, this solved the problem for me:
npm install --global --production windows-build-tools
Thanks to the answer on this question:
node-sass installation issue on windows 10
Depends on which node version you are using. Node-Sass currently supports only these versions:
Supported Node.js versions 0.10, 0.12, 1, 2, 3, 4, 5, 6 and 7.
If you happen to work on one of those versions, try to specify which version of node-sass you want:
$ npm install --save-dev node-sass#4.5.3
your npm is trying to download node-sass version 3.31.1 which is does not exist on the releases page of https://github.com/sass/node-sass/releases
You have an error on your command:
$ npm install node-sass --save-dev-
^^^
Should be
$ npm install node-sass --save-dev
(without the last - on dev)
Also, it is giving you a WARNING because it wants to be installed globally.
See the official node-sass documentation.
And also, could be interesting for you to know the differences between --save and --save-dev.
version mismatch with node could be the issue. To install the working node-sass version, you can use
npm uninstall node-sass
npm install node-sass#4.14.0
remember to choose your version number based on the following table, and the node version you have, which you can check by the command node --version
You can find full info here
While searching for the solution, have checked the release versions of node-sass and found that "https://github.com/sass/node-sass/releases" the node file it was looking is committed in the latest release and not in the older version. After downloading the required file "win32-x64-64_binding.node" manually from the released version and placing it under C:\Users\Administrator\AppData\Roaming\npm-cache\node-sass\4.7.2 or simply by using npm install node-sass#latest works for me.
None of the above solutions worked for me, this is what I did:
Installed C++ build tools for Visual Studio
Then:
npm uninstall --save-dev gulp-sass
Under the same circumstances I tried to install the node-sass package. I got the error that it required different version. The culprit turned out to be the fact that I was installing not under client folder but in the main one.
After that I installed the appropriate version for Node (for example 12 -> 4.12) based on the answer from Error: Node Sass version 5.0.0 is incompatible with ^4.0.0