How to install Electron from a custom mirror - node.js

I'm trying to install electron version 6.0.10 using yarn but getting "error":
read ECONNRESET" at \node_modules\electron\install.js:49.
As per the existing stackoverflow and github help, I have to install electron from a different mirror.
How to do that?
I can use npm if an npm specific solution exists.

Electron can be installed from a different mirror using electron-download npm package.
Install electron-download using npm (for me yarn didn't work for its installation).
npm install -g electron-download
Use electron-download to download the zip of electron from a custom repository.
electron-download --mirror=https://npm.taobao.org/mirrors/electron/ --version=6.0.10
//Change the version accordingly
Now, you can simply run the command in the project directory to install all packages by
yarn
Or
npm install
Or can install electron individually by
npm install electron
In all cases npm or yarn will check for the zip of electron in local workspace and install that.

Related

npm install issues - react native project - mac

I am trying to clone a remote react-native project but I am getting errors when running the npm install command to download all the dependencies in the package.json folder.
I am in the same root directory where the package.json file is.
This is what I get when running npm install:
when I try doing npm install --force or npm install --legacy-deps I get:
I've tried uninstalling node reinstalling to the LTS and current version.
This is the process I followed when trying to install the dependencies:
clone remote repo
npm init
npm install
I am not quite sure what else to do any help would be greatly appreciated.
First you need to get in project directory then install the node packages
cd <ProjectName>
npm install

Unable to start angular4 app using ng serve

I am executing following command in my angular 4 app,
ng serve
But i am getting the following error message,
This version of CLI is only compatible with angular version 2.3.1 or
better. Ple ase upgrade your angular version, e.g. by running:
npm install #angular/core#latest
my angular cli version is 1.6.8.
Even i executed the above mentioned command to update my angular cli, but still same error is getting reported.
Perform Following steps:
1. perform npm cache clean --force
2. Reinstall Angular CLI globally using following command:
npm install -g #angular/cli
3. Delete 'node modules folder' and perform npm install for your project and try running it with npm start/ng serve
From the github issue here: https://github.com/angular/angular-cli/issues/5558
The project needs a dev dependency for #angular/compiler-cli.
npm install --save-dev #angular/compiler-cli#<your angular version>
If that doesnt work you can try this:
npm install --save-dev #ngtools/webpack#1.2.13
One of the main contributors of angular-cli said that it is an issue with older webpack versions, reading the github thread should provide some more insight
To resolve the angular cli error, please try following steps :
npm uninstall —save #angular/cli
npm cache clean
npm install —save #angular/cli

Install packages locally with npm

I am new with Node and npm, and when I try to install packages locally, all of the dependencies for that specific package gets installed in the main nodule_modules folder.
It looks like this
LOCALLY
And if I install them globally it looks like this
GLOBALLY
I think I should mention the fact that the folder where I try to install locally is on Desktop.
If you need to install specific dependancies for a project you are working on then do it locally:
npm install <packagename>
If you need something that you can run from the commandline such as grunt or phantomjs (etc..) then install it globally:
npm install -g <packagename>

NPM Install is not installing dependencies

I'm attempting to install the Ushahidi V3 Client. I've been following the install process up until when I need to build the project from the source repo using npm and gulp - both of which I've had zero experience with. Whenever I run sudo npm install in the project directory, the process runs without complaints. However, when I run npm ls to verify that dependencies have been downloaded, I get a bunch of dependencies listed out as being missing.
How do I get npm to resolve all of these dependencies?
System Details
OS Ubuntu 14.04 (Trusty)
Node JS v0.12.9
NPM v3.5.1
What I've tried
Removing node_modules folder and re-running sudo npm install as referenced in this SO answer for a similar question: npm Gulp dependencies missing, even after running npm install
Uninstalling and reinstalling node and npm
#Strainy, as your research :D
It was a combination of running as sudo and not having the build-essentials.
That's why you should not use sudo npm
Follow these steps:
try npm uninstall. and then try npm install.
Also If it still doesn't work.
Try:
npm install -g npm-install-missing
or
npm-install-missing
For further reading, click here.

Install the latest version of a package that is compatible with the installed version of node

I have node 0.8.22 installed on my dev and production machines. I want to install a package for example gulp or grunt that is compatible with 0.8.22.
If I run the following npm attempts to install the latest gulp package and reports warnings because it requires node > 0.9.
npm install gulp -g
I know that I can run
npm view gulp versions
to get the version list and then use "npm install -g gulp#3.3.2" to get a particular version.
Is there away to do something like the following so I don't have to manually try each version until I get the compatible package?
npm install gulp#Latest_compatible -g
You can use npm-compat. Is easy to use, or you can implement your own way.

Resources