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)
Related
I am trying to run in the terminal of the vs code since I plan to host this online already:
npm install -g firebase-tools
But it is stuck here:
This is my package.json
The version of node.js installed in my computer is:
v14.15.4
Can you try the command with --loglevel verbose
This will show the log information, may point to the issue.
The install generally is pretty smooth, without any problems.
I got Linux. I have just installed Visual Studio and installed npm with it. However, when I type "npm init -y" into the Visual Studio console it says npm command not found. In the normal console I type npm version and it gives me back the version 3.5.2 though. So apparently I have not really integrated it into Visual Studio. Does anyone how to do so?
I had the same problem before... if you want to run npm commands you should go to a directory that your nodejs is installed... if you want to run npm commands in other directories you should go to the directory that you want and then run cmd and type in the commant
set path=C:\Program Files\nodejs\
then you can run all of the npm commands in your directory
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.
Whenever I try to install anything with npm install, I get the following error (usually referencing a different path). I've tried npm cache clean but that gets a similar error. I tried restarting the PC and checked for processes that may be using npm. Followed several other answers and none of the ones I've tried have been successful.
The attached screenshot was taken just after uninstalling node, restarting my computer, removing everything about npm from AppData and Program Files etc. and then creating a brand new project to test in. The project and the directory were created in command line.
Any help would be truly appreciated. Thanks!
SCREENSHOT
You are trying to install the npm using the command
npm install -g cordova ionic
But it is supposed to be like
npm install ionic cordova -g
or
npm install -g ionic cordova
For more info check the below link
Error: EPERM: operation not permitted
I can't get Sublime to show errors such as missing semicolons using JSHint.
I'm using Sublime Text 3, I used the package controller to install SublimeLinter, then installed SublimeLinter-JSHint. I proceeded to install node.js to Windows via the exe, as well as bash via Windows Subsystem for Linux.
I tried to use npm install -g jshint but got an error message I unfortunately did not record. So, I tried to install node.js via bash using:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
Which seems to have worked. Now when I use npm install -g jshint I get:
/usr/bin/jshint -> /usr/lib/node_modules/jshint/bin/jshint
/usr/lib
└── jshint#2.9.5
This makes me think that I've successfully installed JSHint on the Linux side of the bash since it's showing a Linux based path (if that makes sense). I've made sure JSHint is enabled and that it is on the "background" setting.
I'm very new to using terminal commands and installed packages manually, so please take this into account. I've been searching around for an answer for about 2 hours, but I cannot find a similar situation.