Diagnosing npm’s “invalid” error in package list - npm

When I do npm list --global, one package, phonegap, shows as invalid.
npm ERR! invalid: phonegap#5.0.0-0.28.1 /usr/local/lib/node_modules/phonegap
No other packages have any errors or problems. I’ve tried to look into this, and learned that the message means a dependency is unfulfilled, but I can’t figure out which one. If I run npm update --global phonegap it exits cleanly, with no errors.
I originally installed npm & node via Homebrew, if that’s relevant. Here’s my full list of globally installed packages.
How do I diagnose this?

Have you tried changing the permissions for that package? I recently had a similar problem with global packages and it turned out to be a permissions issue
https://docs.npmjs.com/getting-started/fixing-npm-permissions

Related

Why does my 'npm install' give so many vulnerabilities?

Everytime I do npm install after cloning a github project OR install packages on my local system for my practice projects, there are always around 20+ vulnerabilities.
But the guys in youtube tutorials always have 0 vulnerabilities.
I even reinstalled npm but it didn't change anything
If you are following an old video, you are likely installing old packages. Therefore it's pretty common to have vulnerabilities.
If you want the warnings to disappear, you can try to remove #version in your packages inside package.json and then run npm i again. Or, as bogdanoff says, run npm update instead.
But be careful: packages may behave differently from the video when updated.

NPM package doesn't apear in search in npmjs after upload

Several days ago I published a package to npmjs, https://www.npmjs.com/package/pluralize-ru-ts the package is public, i'm pretty sure that the package.json is correct, when i try to npm i pluralize-ru-ts package installs fine, i get no errors.
But the package still doesn't apears in npmjs search in npmjs.org and in npm search pluralize-ru-ts(returns No matches found for "pluralize-ru-ts")
Any ideas, what am i doing wrong?
Just tried npm search pluralize-ru-ts and successfully found you package.
If you are still facing this problem, maybe there are some caching issues.
Screenshoot

Cannot find module ‘#expo/metro-config’ when trying to start the project with expo cli >= 4.8.0

I recently tried to launch my project on a new computer. I downloaded the source code from its repository and ran npm install to get all the needed packages.
However, when I run npm start or expo start:web, I get the error:
Cannot find module '#expo/metro-config'
I ran npm install #expo/metro-config and the install run without issue, but I still get the “Cannot find module '#expo/metro-config'” error.
The only post I saw regarding this error recommends editing the metro.config.js but I do not use one.
I am on SDK 42, and the project launches fine on my other computer. Any idea what is happening?
FYI, I use to perform this whole operation without any issue until now.
UPDATE:
I ran npm install -g #expo/metro-config and now I get the error Cannot find module 'resolve-from'
So it looks like maybe running npm install -g expo-cli doesn't actually install all the necessary packages? Could it be the issue?
I managed to make it "work" (get other missing packages errors down the line) by reverting to expo-cli 4.7.3. Anything from 4.8.0 and above will cause the error.
Something else is that on a fresh npm install, after running npm install -g expo-cli, if I try to create a project with expo init, I will get the error Error: Cannot find module 'kleur'. Running npm install kleur fix it, but maybe that's also a clue.

How can i solve this vue related issue

Am trying to create a vue project using command line but it is showing this error message:
Error unexpected end ofJSON input while parsing near '....67e12ef","tarball":"h'
Using command line, I created a new project in C directory after which, I installed vue using NPM. After that I try installing #vue/CLI globally using NPM but while installing it the above error sprout out.
Have done npm cache clean --force but still the same error..
It is hard to suggest anything because your question lacks details.
However this error often appears as a problem with npm itself.
Consider cleaning npm's cache with following commands:
npm cache clean --force
npm cache verify
If the problem will still occur, please provide more details.

Uninstalling global npm package leaves an error in npm list

I'm having some issues uninstalling some of my global npm packages, in that they don't appear to be fully removing.
As an example, I've been trying to remove the beta Angular CLI package (as this package was renamed for its 1.0.0 release). Running npm uninstall -g angular-cli appears to work, however when I then run npm list -g --depth=0 the package appears to remain in the list, now with an error:
error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/angular-cli/package.json
It appears as though the package has not been fully removed - I'm not sure if this can be fixed using npm prune, or simply by going in and manually deleting any files that may be left over.
I've not had any success googling around the issue, however this could be because I'm not entirely sure what to search for, as evidenced by my not-so-eloquently worded title for this question.
If anyone has any thoughts, I'd be very grateful to hear them!