Errors with installation of firebase npm i firebase - javascript

I am trying to install fire base into my react app but i keep getting an error in the terminal
I tried installing it outside of the app directory and it seemed to install but not in the app's directory

Related

Yarn install, not able to install all dependencies in my project

I cloned a project from gitlab and tried to install the dependencies using yarn install command. But there are few dependencies yarn is not able to install. It is showing this message info There appears to be trouble with your network connection. Retrying...
I tried to install using npm but couldn't do with that even.
deleted package.lock.json, didn't work
It is a next.js based project
Here is the console snap
try disabling proxy/firewall and try again

How to install gatsby-CLI without admin permissions on windows

I am trying to install gatsby CLI by using below npm
npm install --global gatsby-cli
and stuck with the below issue may be because I don't have admin access, anyone any idea how to get rid of this error or install gatsby globally without admin access or if I dont install globally then how to use gatsby command on CLI
You need admin access for installing global packages. However, you can install gatsby-cli on your local machine (where you have admin access), then gatsby build to generate a public directory. Finally, you can deploy your website by copying the public directory to the web server that you don't have admin access to it, for example, by using scp.

Failed to create app with create-react-app in Linux 16.04

I am trying to create new app with create-react-app.
Below is the error.
Please help. Thanks in advance
➜ REACT create-react-app my-app
Creating a new React app in /media/budi/Tjung/#TJUNG/REACT/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.6.0
info No lockfile found.
[1/4] Resolving packages...
error An unexpected error occurred: "http://registry.npmjs.org/react: > ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/media/budi/Tjung/#TJUNG/REACT/my-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /media/budi/Tjung/#TJUNG/REACT/my-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn-error.log
Deleting my-app / from /media/budi/Tjung/#TJUNG/REACT
Done.
error image at CLI
Looks like network problem to me. You could be behind a proxy. If that is the case, configure your proxy in npm like this
npm config set proxy http://proxy_host:port
For https
npm config set https-proxy http://proxy.company.com:8080
Note: The https-proxy doesn't have https as the protocol, but http.
Optionally you can also try,
npm config set strict-ssl false
Checkout this SO answer
check if npm exists on your system.
try the commands in this order.
1. npm install --save create-react-app
2. create-react-app projectname
The name of the project must be in lowercase
Assuming that you have Node installed, you can use npm to install the create-react-native-app command line utility:
npm install -g create-react-native-app
Then run the following commands to create a new React Native project called "my-app":
create-react-native-app my-app
cd my-app
npm start
I have solve this problem.. it is about internet speed connection.
.
When I met this problem, I have spent one day to find out the solution. I read so many article about ETIMEDOUT. I had uninstall and re-install npm and yarn. Still doesn't solve my problem.
.
Until then I found the spot that has high speed internet connection. Fortunately I can create new app with create-react-app.
I think there are problem with your configurations of npm package.
Maybe somewhere, you set up some proxy configuration to npm variables.
You can reset configs running this script in terminal
sudo sh -c 'echo "" > $(npm config get globalconfig)'
and wait until process will end and run
exit
Open another terminal window and try

Can`t make gRPC work with Electron.js

I`m making an Electron app that should connect by grpc to remote host and call some functions from there.
But I keep getting the following error:
Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\?\D:\Projects\demo-app\node_modules\grpc\src\node\extension_binary\grpc_node.node
I tried to:
establish grpc connection from main and from renderer processes of Electron
install dependencies as npm install --unsafe-perm
but nothing works.
Error
The gRPC package is distributed with precompiled binaries for Electron, including on Windows, but you have to specify that you're using Electron when you do the installation. The following should work:
npm install grpc --runtime=electron --target=<electron version>
If you're using a native module, you'll need to rebuild them against your current electron node version.
There is a package called electron-rebuild that will do this for you. Basic instructions:
npm install --save-dev electron-rebuild
Then, whenever you install a new npm package, rerun electron-rebuild:
./node_modules/.bin/electron-rebuild
Or if you're on Windows:
.\node_modules\.bin\electron-rebuild.cmd

How to do npm module installations from the script file itlself

I have a file server.js in which I am starting multiple servers.
eg.
var engine = require('engine.io');
var server = engine.listen(80);
And if the engineio module is not installed in the current directory by using the
npm install engine.io
It throws an error
Error: Cannot find module 'engine.io'
Now on a machine where this server has to be deployed I want handle all these npm module installation dependencies from the script file itself.
How can i do this from my server.js file only
UPDATE
As suggested i tried following the post
Can I install a NPM package from javascript running in Node.js?
but it throws an error when it searches for a node module "npm"
at :
var npm = require("npm");
Reason : i dont have the node modules installed on my machine. ( and so its not having node_modules folder in my working directory)
Also,
I created a batch file in my working directory and put the following into it
npm install engine.io
npm install eyes
And when i run it,
It only installs the first module and then exits
Thanks

Categories

Resources