I have error when give fire-base --version. error- firebase' is not recognized - angularfire

why this error? I have error when give firebase --version. I already install latest nodeJS.
Error like this-
'firebase' is not recognized as an internal or external command, operable program or batch file.

You need to install Firebase-Tools to run command firebase --version
To install, run command:
npm install -g firebase-tools

Related

'expo' not recognized as an internal or external command

I installed expo-cli using npm but after the successful installation, when i try to run expo --version, it shows that expo in nor recognized. I tried adding path to the environment variables but that doesn't seem to work. I have to start working on React Native. Are there any go throughs to this issue?
There is more than one solution to get
'expo' is not recognized as an internal or external command,
operable program or batch file.
Solution 1
Make sure you have installed it global
For npm
npm install -g expo-cli
For Yarn
yarn add -g expo-cli
Solution 2
Make Sure you have added
%USERPROFILE%\AppData\Roaming\npm
to your environmental Variable. I already faced this issue and solved by adding above to my environmental Variable
Solution 3
I don't know how to category this solution, Try to run
npm cache clear -f
in your terminal and
npm install -g expo-cli

Issues running truffle: command not found

I'm trying to deploy a Smart Contract, before that I need to run truffle compile but I get the error
bash: truffle: command not found
I've installed truffle with npm globally and locally, I tried these commands (worked for someone else in my course)
npm init
npm i truffle
./node_modules/.bin/truffle init
but when I run
npm i truffle
I get "unsupported architecture" amongst tons of other errors. all of these fixes are not working, how can I fix this problem from the root of it?
Also trying sudo:
sudo npm install -g truffle
does install it i guess but also gives the error:
truffle#5.4.14 postinstall /Users/khalidhamid/.npm-
global/lib/node_modules/truffle
> node ./scripts/postinstall.js
Error: EACCES: permission denied, open
'/Users/khalidhamid/Library/Preferences/truffle-
nodejs/config.json'
regardless, it still gives truffle: command not found
Is there any specific reason to install truffle using npm i truffle in your project? I mean, just install it globally and cd into your new directory and use truffle init to craft a new project. This way you can use truffle architecture to write your contracts and also use all available truffle commands. Also using truffle config file you can change the solidity compiler version according to your needs.

How to run npm after installing

I want to run npm pakage after installing
c:/>npm i -g pakagename
c:/>pakagename parameters
but I got error 'packagename' is not recognized as an internal or external command,
operable program or batch file.
try : npm install <package-name> -g
it will install that package globally to your system
then check it by checking its version. like
package --version
then do whatever you want
like : https://stackoverflow.com/a/15157360/6747191
To run your installed package with npm you can run it by this command
npm run-script <command> [-- <args>...]
Alias: npm run <command>
According to this documentation: https://docs.npmjs.com/cli/run-script

Truffle command not found after installation

I installed truffle through npm with the following:
sudo npm install -g truffle
but when I run truffle list on the console it just gives me
bash: truffle: command not found
I had a similar problem. I ran npm i -g truffle and then when I tried to run truffle init I got an error: zsh: command not found: truffle. What solved it for me is to create a local node_modules with truffle installed in it, and then run that copy.
run npm init and make a new npm project
run npm i truffle
run ./node_modules/.bin/truffle init and it should work!
Please make sure you have the latest version of npm and node installed. I had the same issue, I updated npm and node to latest version and it worked.
npm install -g truffle works.
After installing truffle:
npm install -g truffle
Run on your project folder:
npx truffle init
I did it on a Virtual box and had the same issue, but it worked after I restarted the computer. Hopefully that works for you too
You should add the following to your path system variable.
C:\Users\UserName\AppData\Roaming\npm
(This folder contains the truffle.cmd file)
I have tried and it works.
I tried everything. Followed the instruction on official truffle website and above answers.
Still it didn't seem to worked.
Finally, this worked for me.
Go to C:\Users\Username\AppData\Roaming\npm
There you will find truffle.cmd Double click on it and your done.
npm i truffle does the exact same thing as npm install -g truffle except that installs it globally, and without -g it will be installed on the local folder. Try to update the npm, node, and probably you have a broken node installation from previous versions.
Using npm install -g truffle worked for me instead of npm i truffle
Nothing above worked for me, but I did:
nix truffle unbox react
truffle develop
atom . //opens up the react file project in the atom platform
Try to start with your command like
npx truffle <your command>
You should add C:\Users\UserName\AppData\Roaming\npm (it contains truffle.cmd file) to the path user variables. I have tried and it works
If you have a custom path for your packages, then make sure that you are exporting it when the terminal loads.
For bash:
nano ~/.profile
For zsh:
nano ~./zshrc
And add your custom path, most of the time this will be "npm-global".
export PATH=~/.npm-global/bin:$PATH
These are two simple steps the properly solve this problem for Linux Users:
1- Configure npm to install software globally in your home directory as follows :
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
2- If you are using bash, then execute the following:
echo -n "export PATH=~/.npm-global/bin:$PATH" >> ~/.profile
However, if you are using zsh instead, then execute the following command:
echo -n "export PATH=~/.npm-global/bin:$PATH" >> ~/.zshrc
Note that, if you are using both bash and zsh, it is better to execute the two commands above.

migrate command not found error even if migrate is installed

I have executed command -
npm install migrate
and it has executed successfully. But when I try to execute the command migrate in terminal it gives me error as migrate command not found
Please find image here.
Has anyone got the same error?
try installing it globally
npm install migrate -g
I have two solutions to this problem.
The first is to attempt to install the package globally.
npm install -g migrate
If above  solution not worked, it could be due to the current user's undefined ExecutionPolicy.
As an administrator, run the following PowerShell command:
Set-ExecutionPolicy RemoteSigned