Problems installing Chocolatey, npm and grunt-cli

I am having a problem installing node packages on Windows 8.1. After installing node with Chocolatey, I followed these steps:

Install Chocolatey
choco install npm
npm install -g grunt-cli

      

So after doing the above, I open a cmd prompt in admin mode and type 'npm', it works fine in any directory and gives me the usual stuff to use npm. Then I type "grunt" and I get "grunt", not recognized as an internal or external command ... ".

So, I think this is the PATH problem it most likely is.

My PATH had nothing to do with npm on it, so I added 'C: \ Users \ MYNAME \ AppData \ Roaming \ npm' to it, tried grunting again, no luck. I looked in "C: \ Users \ MYNAME \ AppData \ Roaming \ npm \ node_modules" and nothing is installed, so I ran "npm install -g grunt-cli" again and noticed

C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.33\tools\grunt -> C:\ProgramData\chocolatey\lib\nodejs.commandline
.0.10.33\tools\node_modules\grunt-cli\bin\grunt
grunt-cli@0.1.13 C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.33\tools\node_modules\grunt-cli
├── resolve@0.3.1
├── nopt@1.0.10 (abbrev@1.0.5)
└── findup-sync@0.1.3 (lodash@2.4.1, glob@3.2.11)

      

So after looking at this npm installs everything in 'C: \ ProgramData \ chocolatey \ lib \ nodejs.commandline.0.10.33 \ tools \ node_modules' my question is, should I just add this to my path and work forward or is there something -what can I do to force npm to use the default install location at "C: \ Users \ MYNAME \ AppData \ Roaming \ npm" as the npm cache at "C: \ Users \ MYNAME \ AppData \ Roaming \ npm -cache 'seems to fill up as expected?

thank

+3


source to share


2 answers


NPM may be an older tool from this package. I understand that they no longer offer a separate NPM from NodeJS (I might be wrong here, I would like to be wrong).

I would rather use the nodejs.install package (which comes with npm).



To answer your question: the location with the package version is not optimal, but I'm not sure if NPM knows a better location compared to the version that is missing. I don't have a good answer to getting NPM to look at the correct install location based on using the NPM package (which is 1.4.9). https://en.wikipedia.org/wiki/Npm_(software)

+3


source


Thank you for your reply, your right from my understanding. It's a problem with installing npm via chocolate, which is what I thought, but you cleared it up.

The fix was to remove the chocolate node_modules folders and npm from the chocolate one, remove my PATH and then install node.js from the node.js website, and bundled with npm it updated my PATH and now everything works as expected ...



Thanks again!

+3


source







All Articles