I have installed yeoman npm install -g yo
and a controller etc. npm install -g generator-meanjs
I get this error :
You don't seem to have a generator with the name meanjs installed.
You can see available generators with npm search yeoman-generator and then insta
ll them with npm install [name].
To see the 0 registered generators run yo with the --help option.
and running yo in cmd (I'm on windows) also returns 0 generators, only menu to install.
What to do?
You must to re-install your nodejs with the latest version.
add environments variables to path
NODE_PATH = C:\Program Files\nodejs;
npm root= C:\Users\<username>\AppData\Roaming\npm\node_modules;
and it will work .
Related
Hello i am using npm in my laravel project. i installed npm and when i command npm -v, i receive 5.0.0 . but when i try to npm run watch or npm run dev i get following error :
enter image description here
Please help me to resolve this problem. i searched too many in sites but didnt find a way to solve this...
Try updating node:
Windows OS
Get the stable installer in Node.js website
Linux OS
npm install n -g
n stable
I had node sass installed globally on my machine previously then after a reset I had to reinstall.
I have tried installing it globally as I use it to compile .scss files in specific directories. After trying to install it globally and reinstall it globally it does not work. I did this on a separate machine and it works without issues.
Tried the following:
npm i node-sass -g
npm install node-sass
npm install -g node-sass
$ node-sass -v
bash: node-sass: command not found
You can use npx to run node-sass. npx will check if you have a global path to the npm package, and if not, it will temporaily download and execute it.
For instance, to run node-sass and check version.
npx node-sass -v
I tried installing node-sass globally on my linux PC, then running node-sass -v and it worked.
Assuming that you are running your commands on Linux, you might not have your npm home in your $PATH, so your OS doesn't know where to look for when you write node-sass.
To solve this look for your npm home folder (where you have installed node-sass), then add that path to the $PATH environment variable.
You can run npm list -g, and the first output line is the path of your global npm sources (the directory you need is bin, not lib).
You might also want to follow this guide to be able to run npm packages commands as root: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally.
If you do this you should re-install all your global packages in order to have them all in the same directory.
If you are using Windows, is basically the same, only the method of setting the env var changes.
This question already has answers here:
Where does npm install packages?
(23 answers)
Closed 3 years ago.
I have installed some packages using npm install -g and was wondering were they were actually installed?
If I use npm install they are installed in the current directory under node_modules it appears.
I understand how to use the -g flag from (when to use) and (how to use).
When you do npm install -g <package>” then it means you want to install that particular npm module system wide (globally). And when you do without the g option, then module would be installed locally inside the current directory called node_modules.
The -g(global) directive tells npm to install the package in the global shared node_modules folder and usually you get that where nodejs resides(Path: C:\Program Files\nodejs).This will also allow you to access the module from the command-line at global level.
You can also check where global packages/libraries are installed:
Run below command
npm list -g or npm root -g
In windows:
C:\Users\admin>npm list -g
C:\Users\admin\AppData\Roaming\npm\node_modules
In mac: you find node_modules here
/usr/local/lib/node_modules
Whenever you put -g then it installed that file globally and that can accessed in any folder you wants then you don't need to install again again same package.
For more details.
You can also check where local packages/libraries are installed:
run npm list or npm root
And, when you simply install then that particular package restricted to that folder.
So, whenever you package dependencies at global level then you need to put -g while installing folder.So,
If you’re installing something that you want to use in your program,
using require('whatever'), then install it locally, at the root of
your project.
If you’re installing something that you want to use in your shell, on
the command line or something, install it globally, so that its
binaries end up in your PATH environment variable.
check this.
Hope it helps.Thanks
I am not sure why my MEAN install is not working. I am trying to get a test page on localhost:3000 for a class that I am taking. here is a screenshot of my terminal:
my terminal
Your must be install yeoman to install and create a MeanJS project.
The scaffolding tool (you may have already installed it as it is part of the Yeoman tool set). To globally install yo, you will need to use npm:
$ npm install -g yo
Install the generator, with:
$ npm install -g generator-meanjs
Finnaly, create a project
$ yo meanjs
I noticed you're trying to use mean-cli. Taking into account that you included the meanjs tag, I will respond based on this.
Well, you do not specify what mean framework you're using, I think Mean.IO is that.
I'm trying to use grunt with sass and have been following these guides:
http://gruntjs.com/getting-started
http://benfrain.com/lightning-fast-sass-compiling-with-libsass-node-sass-and-grunt-sass/
http://www.hongkiat.com/blog/grunt-command-not-found/
I've:
Intsalled node.js
Installed the command-line version of grunt: sudo npm install -g grunt -cli
Added the path from the grunt installer to my bash profile: export PATH=/usr/local/lib/node_modules/grunt/bin:$PATH
Made the profile an executable: source ~/.bash_profile
Setup package.json and Gruntfile.js files in my project root
Installed grunt into the project: cd /path/to/project/root/ and sudo npm install
But when I try to run grunt I see: command not found
It's the same if I run: grunt --version
I wasn't sure if the bash path needs /bin on the end as per the blog posted above but have tried it both ways:
/usr/local/lib/node_modules/grunt/ and /usr/local/lib/node_modules/grunt/bin/
I've also run the grunt installer several times but didn't see any errors so am positive it's installed - can anyone see what I'm doing wrong? I'm running OSX mavericks incase this is the issue.
Any pointers in the right direction would be much appreciated.
Cheers
You have a typo in your command. The package is named grunt-cli without the space.
Update the command to:
sudo npm install -g grunt-cli
And all should work as expected.
Hope this solution also might be helpful to someone. In my case it was a bit trickier.
In command line type the following command
npm install grunt-cli -g
This will show you the location where the grun client is installed:
Copy this location and paste it into a file browser. Was this in my case.
C:\Users\zkhaymed\AppData\Roaming\npm\node_modules\grunt-cli\bin
This will open you the location of a grunt file.
Click on the address line of the location and copy it as a text clicking on the right mouse button.
Now go to the Advanced properties of the system at control panel, and paste this address into a System variables and user variables without deleting the other variables.
I was having a very similar issue, hopefully this helps.
1) You want to check where node and npm are actually installed. If you used a package manager, such as Homebrew or MacPorts, there may be an issue with the location. Just use the downloadable installer from node.js website. Make sure to use the current version, not the long term support (LTS). The installer will install node and npm in /usr/local/bin, which should already be in your PATH. If you already have node/npm installed you can use which node and which npm to see where they are currently located. You should see /usr/local/bin/node and /usr/local/bin/npm, respectively. You will need to update npm after installing with npm update -g npm. This may require sudo.
2) Once node and npm are correctly installed/updated go to the project's root directory (where you have the Gruntfile.js and package.json) and install Grunt using npm install grunt --save-dev. Remember that Grunt After doing so you should see a new folder called node_modules.
3) Make sure to do the previous step before installing the CLI. You can use Grunt's getting started documentation to help guide you the rest of the way. Just be aware that the instructions for installing Grunt are further down the page than installing the CLI, which makes it somewhat confusing. When Grunt and Grunt-CLI are installed run npm install and run grunt in the command line to execute your Gruntfile.js.
You should now be able to see the versions installed. Note that if you are outside of a project's root directory you will not see a version of Grunt but you will see the Grunt-CLI version. This is because the CLI was installed globally (used from any directory/subdirectory) but Grunt is installed on a per-project basis.
Hopefully this helps!
I just ran into this scenario as well. The following worked for me:
Try deleting C:/Users/{username}/AppData/Roaming/npm and C:/Users/{username}/AppData/Roaming/npm-cache (if it exists) and reinstalling global npm modules.
Source: https://github.com/nodejs/node/issues/29287
I had to add this to the PATH (on a Mac after brew install node ):
export NPM_HOME=/usr/local/Cellar/node/6.3.1/libexec/npm
The npm install was not effective, no matter what args I passed to it.