ng is not recognized as an internal or external command(Angular 6) - angular6

After installing Node(latest version). I ran command npm install #angular/cli -g, it installed angular cli successfully. Then to verify it's installation, I tried to run ng v, but got the error message saying:
"ng is not recognized as an internal or external command".
After some research, I came to know that I need to set the system variable path "C:\Users\jaiprakash.mewada\AppData\Roaming\npm\node_modules#angular\cli\bin", but it still not worked for me.

In place of "C:\Users\jaiprakash.mewada\AppData\Roaming\npm\node_modules#angular\cli\bin", I tried with path "C:\Users\jaiprakash.mewada\AppData\Roaming\npm" only and it worked.
We need to make sure, we are setting up the path of folder, where it can locate the "ng" files as shown below. I guess, in earlier version, ng files used to locate in bin folder.
enter image description here

Related

Trying to install Moralis-admin-cli

I am trying to install the "moralis-admin-cli" program to make my account and I have to add it the path that the Terminal gave me so it will download in the proper directory.
I did have a problem where the cursor was but that has been overcome.
So when I type in the code as the tutorial tells this how the tutorial shows how to do it and this is the error:
C:\metadata-static-app>npm install -g moralis-admin-cli
'npm' is not recognized as an internal command, operable program or batch file.
I just need to find a way to install this moralis program in the "metadata-static-app" directory on my computer so I can move on to the next step.
Can you help me.
Add node.js on your environment, the npm command will work!

Puppeteer error: "failed to launch the browser process"

I am trying to run Puppeteer on my new laptop. However, I am getting this error:
node:8144) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/mnt/c/Users/juliu/repos/kmj-sniper/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory
What am I missing here?
The error message can either indicate that your operating system is missing the ATK library (libatk), or that this shared library is installed in a location that Puppeteer does not know about, because it is not available from the paths specified in the environment variable LD_LIBRARY_PATH, or has a different name from what is expected.
If the ATK library is missing, what platform your laptop is running will likely determine the answer. If you are running Ubuntu, for example, you could do the following, or similar:
$ sudo apt-get install libatk-bridge2.0-0
On CentOS/RHL, perhaps:
$ sudo yum install atk.x86_64
If the required package is already installed, however, check that LD_LIBRARY_PATH includes the directory where the shared library is installed, and that the filename matches that shown in the error message returned by Puppeteer.
Delete folder node_modules (don't delete the package.json and package-lock.json files) and then run npm i.
It will essentially reinstall all your dependencies.
If that doesn’t work, then try Alex's answer.

warn Package undefined has been ignored because it contains invalid configuration. Reason: Cannot find module 'undefined/package.json'

In my app.json folder, I have everything bundled nicely, but I have one undefined package at the bottom of the install list:
"undefined": "react-navigation/bottom-tabs"
I tried running an "npm install react-navigation/bottom-tabs" but it threw this error:
warn Package undefined has been ignored because it contains invalid configuration. Reason: Cannot find module 'undefined/package.json'
Has anyone encountered an issue like this before? I am running React-Native Version 5 on top of Expo.
EDIT: It turns out that it was supposed to be #react-navigation/bottom-tabs, so I installed that and made an adjustment; but now I am still stuck with the original undefined package in my app.json folder, and cannot get rid of it.
So, I forgot this post existed and I actually figured this out months ago. When you're dealing with:
A bad bundle,
the wrong version,
or there's just something wrong with your 'package.json' file, (the file that contains the list of your packages)
These steps should fix it:
Perform "npm uninstall 'package-name' " or "yarn remove 'package-name'"
Note: You do this instead of 'expo-uninstall' because 'expo-uninstall' does not exist. We use 'expo-install' instead of 'npm' or 'yarn' install to make sure you download the proper npm or yarn version associated with your version of expo.
Open the package.json file and see if the bad package you uninstalled is still present.
If the bad package is still there, select and delete it from the file, then save.
Run an "expo" "npm" or "yarn" install on the correct package name
This should fix it. This is best fixed when step 4 is executed with an 'expo install' as you likely have an incompatible version of the package, so this will prevent that from happening again.
In my case, I couldn't figure out why my terminal was telling me a specific package didn't exist, so I did a "sud" command to force download the package. This package didn't exist, because I had actually spelled it wrong.
try deleting your node modules and install them again and make sure your metro is closed
clear cache and you are good to go by the way it worked for me
npm install or yarn add
npm start --reset-cache

polymer : command not found

I am using ubuntu 16.04. I have install polymer-cli npm install -g polymer-cli which is properly installed but when I enter command polymer server
it is throwing error that polymer:command not found.
To check if a package is globally installed you can take a look at the npm root folder.
npm root -g will show you the root folder
ls $(npm root -g) therefore lists all public installed packages.
If you do not find polymer-cli there then your global installation was not successful... if you find it there but you still can not use it you probably want to try to reinstall it.
For me the answer relied in the fact that the bin folder of node wasn't defined in PATH.
The fix for me was to add it to the export PATH= part in my .zshrc-file or, if you don't use ZSH, .bash_profile. To know what to add to this PATH export run npm bin -g. For me the output was /usr/local/Cellar/node/11.14.0_1/bin. After this I opened my .zshrc-file and added the :/usr/local/Cellar/node/11.14.0_1/bin to the PATH definition. Notice the : which distinguishes a new location.
export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin:/usr/local/Cellar/node/11.14.0_1/bin"
Good luck!
If polymer-cli is globally installed successfully, change your path environment variable - add polymer.js' parent directory to it and polymer serve will work. You'll find polymer.js in .npm-global/bin

json file location in command prompt

I am trying angularjs-2 for the first time from the example found here
and everything was working fine until I came to a point where the author has written something like this
Now open the package.json file location in command prompt and execute
the below command to load the required modules and supported files
which are mentioned in the package.json file.
npm start
after reading this I open command prompt by pressing window+R and write cmd
and I enter the following path
E:....\nodejs with angular2 testing\nodejs with
angularjs2\nodejs with angularjs2\
but i am not able to do anything after this point
how can i execute the package from command prompt,?
i tried the same with developer command promt but facing the same issue,
hey guys i know i am bad in english but please i need help here
First you need to have nodejs in your system.
If you don't have nodejs, then download it. which shifts npm with it. [It is similar kind of stuff what nuget does in VisualStudio.]
As you mentioned package.json is already there in your project then you need to got to you Application folder in command prompt to install packages by running npm install.
For example : If your App folder is in E:\Project\Myangular2App,
then after opening Command Prompt with window+R, navigate to E drive by E:, then navigate to your App folder by cd Project\Myangular2App and run npm install. This will install all the packages mentioned in package.json
start seems to be a script configured in your package.json which probably runs something else.
Please state if npm (the node package manager) runs on your CLI without any argument. If not you have to get npm working first. It has to be in your $PATH variable in order to function anywhere.