npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

I cannot get NPM to install properly

I would try to re-install node.js (which should restore the npm command).


Ok. I thought installing it globally enabled whatever I installed to be accessed from anywhere.


I need literals, because I don’t have enough background to assume things, in this context.

I did a whole re-image on my machine and hopefully that’s resolved it.


still can’t seem to upgrade.


This all seems normal, expected behaviour, and on top of that non-fatal errors and warnings. What are you trying to do?


Sorry for the confusion. I didn’t literally mean

npm config set prefix '...'

I meant replace the ... with whatever the prefix should be. So it would probably be

npm config set prefix /Users/jkidd/.npm-global

In this case, I think. However, that all depends on your PATH. You want the directory

/Users/jkidd/.npm-global/bin

to be on your path, specifically.


There’s a guide here.


nope not intentional. Ok. how does one go about fixing that.


No, global mode is meant for executables:

  • Install it globally if you’re going to run it on the command line.

(source

Installing it in your project also makes it easier to set up that project somewhere else. Then, all the dependencies are defined in package.json, instead of all over the place.


I just reinstalled node and I’m still not able to execute some commands.


I used create-react-app to initiate this project/app so react should be there


Hello - I cannot seem to get NPM to work on any directory of my system. Nothing but issues. I’m not sure how to resolve this at a global level.


The warning was emitted because formik was installed globally (that’s why it shows with npm list -g). If your local project already has react, installing formik locally should be enough.


What’s weird is that npm normally isn’t in that directory in Windows. Anyway, check

npm config get prefix

This probably gives the .npm-globa one. If it does, you can change it with

npm config set prefix '...'

You’d have to reinstall global packages (or move the directory .npm-globa to .npm-global, but that’s risky).

I’ll be back sometime tomorrow (it’s 12 AM here now)


I think it’s something larger than that. I think I mucked up my bash file and have no idea how to recover.


no worries. appreciate the assist.


Your mom is uglier than a whorr


There seems to be a typo in some prefix config somewhere: .npm-globa. Or is that intentional?


it is npm upgrade, not npm-upgrade (no dash between the two commands)


trying to install formik into my project. I screwed up my bash somehow and can’t figure out how to fix it.


ok. I’ll try that. Is there a way or me to ensure things are uninstalled everywhere? then reinstall?


To create a project, you need a directory with a package.json file. Then, to install formik you can run

npm install formik

in your project directory. To use formik, you also need to install react (that’s what the “UNMET PEER DEPENDENCY” warning is all about).