In the process of setting up MEAN Stack,
After installing meanio module on node 0.10.26, I can not pass through the command "mean init myApp".
1. npm install -g "meanio'
2. mean init myApp
This always gives me "Prerequisite not installed: undefined".
Could you pls look at it ?
Regards
Ram
Sometimes it is neccessary to clear npm cache to make sure you really get the latest version you can use the npm cache clear command. There have been a few releases over the last few days so clearing npm cache might help you
Here is a summary of the install procedure.
sudo npm install -g meanio#latest
mean init <your app name>
cd <your app name> && npm install
grunt
Checkout http://www.mean.io/#!/docs for full documentation and make sure you meet all the prerequites.
If you are a windows user and already installed Git on your machine, first add git to path in environment variable, then try it. It should work.
I too encountered the same issue.Though I have installed GIT on my mcahine, i was getting the error
"Prerequisite not installed: GIT" while running the command "mean init myApp".
This is because your command prompt doesnt know the path of GIT exe file.
I resolved this by adding the GIT path under Environment variables as shown here http://blog.countableset.ch/2012/06/07/adding-git-to-windows-7-path/
Right-Click on My Computer
Click Advanced System Settings link from the left side column
Click Environment Variables in the bottom of the window
Then under System Variables look for the path variable and click edit
Add the path to git's bin and cmd at the end of the string like this:
;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd
Please make sure that your give the correct path of GIT folder in the path under Environment variables.in your case it might not be same as mine.check where GIT files were created while installing.
Make sure you have a recent version of Git installed. That error should read, "Prerequisite not installed: git". I'll take a look at why it says undefined instead.
As user3211907 meantioned, please take a look at http://www.mean.io/#!/docs for full documentation.
Ram,
It is problem with git
install git and this problem should solve
To install git in Cent OS or any RedHat flavors use
yum install git
Related
I installed nvm and then installed npm by nvm install npm.
Nvm and npm have been installed to my main directory ~/.nvm and ~/.npm.
And yes, npm command is correct in every directory in the server on the ssh connection in console.
I added also build.sh file where I wrote npm run prod command and added this in post-receive git hook.
BUT! When I send new commits to this server, I see in console note like "npm command not found".
WHY????
After all, on the server everything is okay!
I tried also move ~/.npm to /usr/local/bin/ but it wasn't help. Probably because .npm it is a folder. I don't know...
I solved problem by deleting .nvm and .npm folders and installing npm through sudo apt-get. I guess it automatically have added needs files in needs directories to make npm command globally available.
In spite of I solved the problem by another way, I want to know what I was doing incorrectly in the first approach, cause maybe in the future I need nvm. Can someone experienced in linux explain me what the problem was?
Make sure the absolute path where npm command was installed is listen within your PATH variable, then make sure you export this variable so your build.sh script can see the new value and search for npm binary.
echo $PATH
export PATH="/path/to/my/installation/:$PATH"
echo $PATH
./build.sh
I following this online tutorial on downloading and installing web files from GIT HUB. I got down to the topic: Starting Our Static Website, there I'm prompted to enter the commands to download and install the web files. However, when I enter the command yarn install, I get the following prompt: bash: yarn: command not found
How can this problem be resolved?
I'm using GIT Bash command prompt on Windows 10.
If you are using Mintty (Bash) then you simply do npm install -g yarn
You probably just did not install yarn yet.
Have a look at the yarn installation for Windows here:
https://yarnpkg.com/lang/en/docs/install/
The official Yarn setup does not tell you you need to restart your computer, but you actually have to before you can use it from your shell. So, install it from
https://yarnpkg.com/lang/en/docs/install/#windows-stable
then restart your PC and you should be able to run yarn from your console.
Working in Visual Studio Code?
Open a new terminal
Click "Terminal" → "New Terminal"
or
Simply use ctrl+shift+` (backtick)
(this backtick button is on the left of the 1 key and below Esc)
Once the Terminal is active, install Yarn by running npm install -g yarn.
Verify the installation was successful by running yarn --version.
I followed the official yarn installation for windows but is loading a page no found on github
https://github.com/yarnpkg/yarn/releases/download/v1.22.17/yarn-1.22.17.msi
so I had to the manual way which is adding the path into the environment variables
asuming you already have installed npm, if you are not sure type in the terminal npm -v
install yarn on the terminal using npm install --global yarn
check the yarn packages has been installed on
C:\Users\yourusername\AppData\Roaming\npm\node_modules\yarn
if you can see the package on your node_modules you just need to add the bin folder that is inside the yarn into your environment variables
On the Windows taskbar, right-click the Windows icon and select System.
In the Settings window, under Related Settings, click Advanced system settings.
On the Advanced tab, click Environment Variables.
Click on Edit and add C:\Users\yourusername\AppData\Roaming\npm\node_modules\yarn
Press ok save open a new terminal and try running yarn -v
What resolved this for me was repairing my Node install:
Go to Add or remove programs
Search for "Node.js"
Choose Modify
Choose Next and then Repair
After doing that I was able to run yarn without issue.
If you install yarn through MSI on windows10, and the software installed on C:\Program Files (x86)\Yarn\bin, but the path set in C:\Users\{username}\AppData\Local\Yarn\.bin, so change the path(both user and system) to C:\Program Files (x86)\Yarn\bin.
Try to type yarn.cmd on git bash, it should work fine.
for example: yarn.cmd --version.
Please check first that yarn is install or not globally
C:\Users\username\AppData\Roaming\npm\node_modules\yarn
If there is, then add this to your environment variable
C:\Users\username\AppData\Roaming\npm\node_modules\yarn\bin
Download and install yarn wizard first in order to run commands related to yarn.Click on the below link to start the download automatically:
https://yarnpkg.com/latest.msi
I could reproduce the same issue on git bash. However when i tried the same in command prompt it worked!
on bash - $ yarn add axios
bash: yarn: command not found
on command prompt -
yarn add v1.22.5
....
[1/4] Resolving packages...
It looks like there might be an issue with Yarn and certain environments. See this GitHub issue for more details.
I had same issue and for me install yarn by the installer
From the yarn official website Yarn Official website
Read through this if nothing helps:
https://bobbyhadz.com/blog/not-recognized-as-internal-or-external-command-yarn
for me i had to add environment variables as npm did not install in the "correct"/standard folder
On Windows, the output of the npm config get prefix command will look something like: C:\Users\Your_User_Name\AppData\Roaming\npm.
To update the PATH on a Windows machine, you have to:
Open the start search and type in env and then click "Edit the system environment variables"
Then click "Environment Variables"
Edit the Path variable and add the output you got from the npm config get prefix command.
The path should look like C:\Users\Your_User_Name\AppData\Roaming\npm (make sure to replace the Your_User_name placeholder with your actual username).
even tho I installed npm and yarn corect, when I check the version, the same error already appears:
393330#785-5949 MINGW64 /c/Users/393330/Desktop/intranet-app
$ npm install --global yarn
changed 1 package in 344ms
393330#785-5949 MINGW64 /c/Users/393330/Desktop/intranet-app
$ yarn --version
bash: yarn: command not foundstrong text
If you don't have npm, you can do the following (taken from yarn installation instructions):
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
Use this command on macbook
brew install yarn
I am trying to use Gulp and Node.Js to stream my process for minifying and concatenating CSS/JS files for production.
Here is what I have done.
I installed Node.Js on my Windows 7 machine.
Installed Gulp globally using this command npm install -g gulp
Then I added a new User variable called NODE_PATH set it to %AppData%\npm\node_modules
After closing and re-opening my command line, I tried to run a gulp task from the command line (i.e. gulp css). But that give me the following error
'gulp' is not recognized as an internal or external command
How can I get this to work?
When I opened the following path using the search bar in windows,
%AppData%\npm\node_modules I see the following two folders
gulp
gulp-cli
I've tried to add %AppData%\npm\node_modules to the Path variable on my system variable, but it did not take it because that variable reached it's max allowed character limit.
I removed couple of paths from my Path variable and added ;C:\Users\[MyWindowsUserName]\AppData\Roaming\npm\node_modules
but still not working.
I even tried to set the path at run time using this command
PATH=%PATH%;C:\Users\[MyWindowsUserName]\AppData\Roaming\npm\node_modules
then run gulp and still the same issues.
What am I missing here? What else do I need in order to get this to work?
I had similar issue when I installed locally initially(w/o -g). I reinstalled with -g (global) and then it worked.
npm install -g gulp
you should run gulp from folder where gulpfile.js is available.
I solved the problem by uninstalling NodeJs and gulp then re-installing both again.
To install gulp globally I executed the following command
npm install -g gulp
Go to My Computer>Properties>Advance System Settings>Environment Variables>
Under the variables of Administrator edit the PATH variable & change its value to "C:\Users\Username\AppData\Roaming\npm". Note: The username in the path will be the current Admin user's name that you have logged in with.
I had the same problem on windows 7. You must edit your path system variable manually.
Go to START -> edit the system environment variables -> Environment variables -> in system part find variables "Path" -> edit -> add new path after ";" to your file gulp.cmd directory some like ';C:\Users\YOURUSERNAME\AppData\Roaming\npm' -> click ok and close these windows -> restart your CLI -> enjoy
You may need to install the gulp-cli globally. Uninstall then re-install if you already have it:
npm uninstall -g gulp-cli
npm install -g gulp-cli
Sorry that was a typo. You can either add node_modules to the end of your user's global path variable, or maybe check the permissions associated with that folder (node _modules). The error doesn't seem like the last case, but I've encountered problems similar to yours. I find the first solution enough for most cases. Just go to environment variables and add the path to node_modules to the last part of your user's path variable. Note I'm saying user and not system.
Just add a semicolon to the end of the variable declaration and add the static path to your node_module folder. ( Ex c:\path\to\node_module)
Alternatively you could:
In your CMD
PATH=%PATH%;C:\\path\to\node_module
EDIT
The last solution will work as long as you don't close your CMD. So, use the first solution for a permanent change.
In my case, this problem occured because I did npm install with another system user in my project folder before. Gulp was already installed globally. After deleting folder /node_modules/ in my project, and running npm install with the current user, it worked.
You need to make sure, when you run command (install npm -g gulp), it will create install gulp on C:\ directory.
that directory should match with whatver npm path variable set in your java path.
just run path from command prompt, and verify this. if not, change your java class path variable wherever you gulp is instaled.
It should work.
If you have mysql install in your windows 10 try uninstall every myqsl app from your computer. Its work for me. exactly when i installed the mysql in my computer gulp command and some other commands stop working and then i have tried everything but not nothing worked for me.
I just encountered this on Windows 10 and the latest NodeJS (14.15.1). In my case our admins have our profiles and true "home" folder remotely mount onto our work machine(s). Npm wanted to put its cache over on the remote server and that has worked until this release.
I was unaware that npm has a .npmrc file available. I added one to my actual machine's C:\Users\my-id folder and it contains:
prefix=C:\Users\my-id\nodejs\npm
cache=c:\Users\my-id\nodejs\npm-cache
I also added these paths to my PATH environment variable.
I went to the APPDATA folder on my work machine and the remote "home" server and deleted all the npm related Roaming folders. I deleted the node_modules folder in my project.
I closed all open windows and reopened them. I brought up a command prompt in my project dir and re inited npm and reinstalled the modules I wanted.
After that everything is rolling along.
Just to add to #Vinod R's answer
Go to My Computer>Properties>Advance System Settings>Environment Variables>
Under the variables of Administrator edit the PATH variable & change its value to "C:\Users\Username\AppData\Roaming\npm". Note: The username in the path will be the current Admin user's name that you have logged in with.
After this, move the path to the top as shown in the image attached.
image for demostration
I was having the same exception with node v12.13.1,
Downgraded node to v10.15.3 and it works fine now.
The best solution, you can manage the multiple node versions using nvm installer. then, install the required node's version using below command
nvm install version
Use below command as a working node with mentioned version alone
nvm use version
now, you can use any version node without uninstalling previous installed node.
https://github.com/tejas-manohar/itnerary-civic-hacking -- I cloned this git repo down locally. Installed grunt-cli globally, and ran npm run nss (script written by author of original server template -- look in package.json, not complex) and faced numerous errors at the traceur install + git cloning. I've included the trail from terminal window in the pastebin linked below. The npm debug/error log mentioned is not present at the suggested location. npm install alone does not help the situation and returns nothing back. NodeJS v0.10.29 is installed via Node Version Manager (NVM) on OS X 10.9.3.
http://pastebin.com/UJFL3k2E
I'm not the most adept with some of the technologies discussed here. Would someone please attempt to walk me through (a) solution(s) and/or steps to get better clues? All assistance is appreciated.
There's a couple of problems going on which are causing the problems you have seen. The first of which is the command that is run when you run npm run nss, which fails for you with this:
rm: ../../app/static/js/vendor/traceur.js: No such file or directory
This is because, well, the file simply does not exist (yet). If you look at the commands which are run when you run npm run nss, you'll see that the remove file is followed by the copy file of traceur.js to that very location. So I would guess that whoever wrote the script intended for this to be run after it was initially setup, and the remove/copy would be done once the file was initially copied there. Therefore, you must first copy the traceur.js file to app/static/js/vendor before you can successfully execute npm run nss.
But then the next problem, the file should be copied from tools/traceur-compiler/bin doesn't exist either. This is because the traceur-compiler project has recently deleted this (compiled) file from their project, which you can see via this commit: https://github.com/google/traceur-compiler/commit/429c3d850dcb7636320e81fd782c61a06de0fbf1
So you need to regenerate this file, which you can do by (from the itnerary-civic-hacking root directory):
cd tools/traceur-compiler
make bin/traceur.js
cp bin/traceur.js ../../app/static/js/vendor
This will get you in the same state as if you successfully ran npm run nss.
You won't be able to re-run the npm run nss command, but you really shouldn't need to since its more of a setup command than anything (it creates a directory, clones a github repo, etc). If you wanted to update the traceur-compiler in the future (though you may never have to do this) then I would recommend running the following steps (from the itnerary-civic-hacking root directory):
cd tools/traceur-compiler
git pull origin master
npm install
make bin/traceur.js
cp bin/traceur.js ../../app/static/js/vendor
I am having huge problems trying to use bower (to install foundation 5) or get anything bower related to work on the command line.
I've installed
ruby 1.9.3
git (with run from command prompt option)
Nodejs
I've successfully ran
npm install -g bower grunt-cli
gem install foundation
and these have ran fine. I've looked in the npm/node_modules directory and I can see bower folder in there.
Every time I type bower either into the cmd, ruby cmd or git bash I get
command not recognized
I've set the git path in the environment variables.
What's annoying is the instruction on the bower site. It states:
npm install -g bower
bower install
Well this doesn't work!
I bumped into this problem after npm install -g bower too. I solved the problem by adding npm's binary folder to my path.
Here are some helpful hints for doing that:
Find the location of your npm global binaries: npm config get prefix. This path may look something like C:\Users\username\AppData\Roaming\npm (or C:\ProgramData\chocolatey\lib\nodejs.commandline.X.XX.XX\tools if you use Chocolatey).
Add the path from step 1 to your Path.
Open the Windows Control Panel, search for environment, then click on either edit environment variables for your account, or Edit the system environment variables`.
Find the variable named Path or PATH, or create one if it doesn't exist.
Paste the path from step 1 here (; delimited).
You may need to restart your command prompt window.
You should now be able to enter bower commands.
in case this helps.
I'm a npm / bower nooB - but what happened in my case was, that I was using the Angular JS tutorial,
which seems to have bower set up to be used via npm, and NOT via the command line directly.
Note: in my case I think my bower install got messed up.
I ran this to fix up my bower install:
npm install -gf bower
Then I edited my bower.json file to add in a new library that I wanted to use (in my case angular-sanitize)
I CD to the location of my project
cd myProjectPath
Then to run bower, I actually used npm install:
npm install
This seems to to run bower as a node package, which in turn scans bower.json and installs any missing bower packages.
To run bower as a npm package, add npm before the bower command:
npm bower -v
hope this helps,
Sean
If above solutions don't work. I think you should specify the absolute path to use the bower in command prompt. In my app folder, I just call
C:\Users\yourusername\AppData\Roaming\npm\bower.cmd install
This is content in my bower.cmd. It looks like my windows can't recognize the ~dp0 variable,
node "C:\Users\yourusername\AppData\Roaming\npm\node_modules\bower\bin\bower" %*
This definitly will happen if your Windows PATH variable close to 1024 symbol length. So new links such "C:\Users\username\AppData\Roaming\npm" simply won't fit into that.
Check your PATH, remove extra stuff and try to reinstall node.js and bower etc. Also there is a way to increase 1024-length limit
As others mentioned have to add bower into environment variables, but the easiest way to locate is just simply type in your npm location first, then use Browse File and locate bower on your system(you can search for it in search bar as well), because the location may vary for different users.
1. Type in windows cmd:
for /f %a ('npm config get prefix') do setx path %a
2. Reload cmd
Same issue. I solved it by using another version of bower. It works when i tried to use version 1.2.6
$ npm install -g bower#1.2.6
I had this problem after installing Chocolatey 0.9.8.28. I tried most of the solutions listed here, but I was unable to have 'bower -v' recognized in the Powershell commandline. This seemed a little strange since the Chocolatey Install is 'all about' Powershell. Eventually I was able to succeed by setting the path so that Powershell could find the updated PATH variable settings, but I needed help to understand why and how to do it, which I am providing below:
After failing with Powershell initially, I was able to go to a standard DOS Commandline (not by using cmd /c in powershell) and successfully perform all the variations of path setting that are discussed above and have success in seeing bower and the bower commands recognized by the DOS command line. And the cmd window showed the full updated path (C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.34\tools) - notice that the version number may change from the listing by the honorable KimchiMan.
This PATH persisted through closing and opening new DOS command line windows, but it was not recognized (ever) in any Powershell windows.
Then I discovered the following related discussion: Set Powershell Path Settings.
This points out that Powershell recognizes the HKLM path settings version when starting up. AND it is possible to set the Path EITHER IN the session (non-persistent) or in the Registry (persistent). The following is directly from that discussion.
These commmands can set the PATH temporarily for a powershell SESSION:
$env:Path = 'New path'
[System.Environment]::SetEnvironmentVariable('Path', 'New Path', 'Process')
These commands can set the PATH permanently for all new Powershell Sessions:
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name 'Path' -Value 'New Path'
[System.Environment]::SetEnvironmentVariable('Path', 'New Path', 'Machine')
But I've messed with setting registry settings programmatically before and I don't believe a line or two of PS script is at all up to the task. So I did not even try this option.
Instead I went to the Control Panel/System console and changed the path through the Environment Variables dialog. I noticed that all the effort I had made to change the path with set PATH in a DOS commandline had worked during the windows session, but the new path entry had not been persisted to the Environment Variables/Registry even though the Dos session was running as administrator.
After I made this change through the Control Panel, the updated path for bower in Chococlatey's tools folder (and presumably all subsequent tool installs) were permanently set and bower was available in both the DOS command line and in the Powershell command line.
hope this helps...
Uninstalled 64bit and Installing 32-bit version of nodejs along with git-
32bit worked!
Had the same issue.
I just ran "npm install -g bower" then visited the directory where it was downloaded, in my case the location was "C:\Users\user\AppData\Roaming\npm\node_modules\bower"
From the directory I ran bower, and everything working fine, even from other directory