npm - yo - yeoman-environment/generator error - node.js

npm ERR! peer dep missing: yeoman-environment#^3.2.0, required by yeoman-generator#5.4.1
When I check the list of npm package available with command 'npm list -g --depth=0', I get the above mentioned error.
Can someone please help me understand it?

It is resolved now.
I have uninstalled yo and generator-code first.
Then I have updated nodejs and npm version to LTS version.
Then again installed yo and generator-code. It gave the same warning that required yeoman-environment was missing.
I have installed yeoman-environment.
Now everything is alright. I am able to use yo and generator-code.

Related

npm ERR! must provide string spec

I'm having this error since a while, in this case, the problem occur executing the following command.
npx create-react-app my-app
Actually, it happens with any npm commands as well, I tried deleting package.json, changing npm versions and yet didn't work, so I'm here asking for help.
This is the entire error:
C:\Users\c>npm install
npm ERR! must provide string spec
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\c\AppData\Local\npm-cache\_logs\2022-01-28T16_50_23_009Z-debug.log
Version of npm and node:
node --version
v16.13.2
npm --version
8.3.2
I had the same issue, it was a missing version in my package.json
look like mistakenly I removed some text
"dependencies":{
"angular/cli" :"{}"
}
try to update your npm: npm upgrade
then: npm clean cache
Following, i'm in the exact same position. Tried changing the NodeJS version using NVM and now some of the commands work (npm -v shows im running 8.1.0) but npm update and npm/npx create-react-app give me an " ERR! must provide string spec " !
I faced this same issue yesterday.
This is what I did to resolve it:
Uninstalling node entirely and removing node_modules and package.lock.json from the project directory.
Install node afresh and run npm install in your project directory.
I tried to reactivate an old project which had packages noted down differently then usual in package.json. They had an id and locator parameter, like:
"ImagePicker": {
"id": "ImagePicker",
"locator": "https://github.com/dhavalsoni2001/ImagePicker.git"
}
After removing / replacing them by version numbes, i could install.

Why am I getting error "No valid versions available for undefined" while installing create-react-app

I'm trying to install React through command prompt. NodeJS is already installed.
When I try to run this command:
npm i -g create-react-app
It is displaying error as shown below:
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for undefined
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xyz\AppData\Roaming\npm-cache\_logs\2019-12-10T10_51_39_2222-debug.log
Sometimes this can happen when you are using a private NPM registry / proxy registry and it has corrupted metadata. I've seen this happen with Sonatype Nexus 3 - there were corresponding error messages in the server logs.
Are you sure you have the right Node version? Try updating NodeJS or try running: npx create-react-app my-app
you should check this out issue.
If the problem still exist, please check your versions with this:
npm -v
node -v
For me this error came up because I had a version number that did not exist for a package I wanted.

Installing of Angular is not successful. No errors shown

If you look a the picture I made sure I had npm and node and then tried to install Angular CLI and it does not give me an error or anything. I am not sure what I have done. This laptop did crash a while back and I reloaded it not sure if that would contribute to this issue.
I even updated npm and node to the latest to see if that would fix the issue. I am on Windows 10 Home edition. The angular CLI seems to be working on my home desktop. How can I get this working again even if I uninstall something to get it working correctly.
I thought it was NPM but somehow I have the loglevel set to silent.
Try installing it globally,
npm install -g #angular/cli
Give an uninstall a try.
npm uninstall -g #angular/cli
npm cache clean
npm install -g #angular/cli#latest
In the screenshot you posted, there is this line
npm ERR! npm -v 1.3.21
Maybe you should reinstall node also.
I finally uninstalled NODE completely and found the extra folders left over and reinstalled and that has fixed my issue. Nothing to do with Angular. Thanks for helping.
Try this:
npm install angular-cli

npm WARN deprecated npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm

As I was trying to do a MEAN Stack installation on my Windows 10 computer.
My npm version is:
C:\Temp>npm -v
2.7.4
My Node.js version is:
C:\Temp>node --version
v0.12.2
npm install -g yo --prefix C:\yoPackage
(Minor Side question: I'm trying to specifying the location where I want the packages installed. To elaborate, the aforementioned command specifies C:\yoPackage as the place where I want yo package files to be placed. What kind of stumbling blocks might I face if I personally specify a installation location for the a package that npm needs to install? )
The problem is that the aforementioned setup commands for yo gives me the following error:
I ran the following update npm command:
npm -g install npm
However, I still the error in the aforementioned error in the screenshot above.
Could someone please tell me the steps I need to take to resolve the error?
Update:
I just ran the following to set the proxy configuration variable to some empty-like value:
C:\WINDOWS\system32>npm config set proxy
I also just ran the following clean-up:
C:\WINDOWS\system32>npm cache clean
I re-installed npm:
C:\WINDOWS\system32>npm -g install npm
Finally I re-ran the yo installation command using npm:
C:\WINDOWS\system32>npm install -g yo --prefix C:\yoPackage
Here is a screen shot of the output when I ran the aforementioned command:
The "deprecated npmconf" stuff is only a warning and is not the source of your problem.
Your problem is the ECONNRESET stuff which is an error. As the error message says:
This is most likely not a problem with npm itself
and is related to network connectivity.
In most cases you are behind a proxy or have bad network settings.
If you are behind a proxy, please make sure that the
'proxy' config is set properly. See: 'npm help config'

Why does npm list -g lead to npm ERR! missing error?

npm returns the following message after using npm list -g
npm ERR! missing: atom-package-manager#*, required by undefined#undefined
npm ERR! missing: opal-npm-wrapper#git://github.com/anthonny/opal-npm-wrapper.git#0.1.1, required by asciidoctor.js#1.5.2
npm ERR! missing: xmlhttprequest#~1.6.0, required by asciidoctor.js#1.5.2
screenshot:
I know this an old question but I've been strugging with a similar issue and figure I'd at least add what worked for me...
Problem
Running npm list -g lists all packages as expected and then throws a variety of errors including the missing errors, as mentioned above, and, for me at least, a bunch of invalid and extraneous errors such as this:
extraneous: aws-sign2#0.5.0 /usr/local/lib/node_modules/npm/node_modules/aws-sign2
I tried a bunch of solutions including npm upgrade, npm prune, as well as installing missing packages, which for me was semver:
missing: semver#2 || 3, required by normalize-package-data#1.0.1
I'm still not sure of the exact cause for these errors, though I believe this happened when I upgraded to 3.3.6.
Solution
After some headache I ran:
npm update -g --verbose
which upgraded me from v3.3.6 to v3.5.3 and got rid of all the errors. Note that the --verbose is not necessary but helpful to see what exactly is happening. Now my npm list -g returns a clean output:
/usr/local/lib
├── npm#3.5.3
└── semver#2.3.2
Hope this helps someone, please comment if I've stated any inaccuracies or if there's something I can add here.
For anyone having the same problem, try to run:
npm dedupe
for more info about npm dedupe please refer to the documentation.
https://docs.npmjs.com/cli/dedupe.html
Remove package-lock.json in /usr/local/lib.
You must have a global package named asciidoctor.js that is installed before its dependency packages are installed. I ran into the same problem today: some of my global package has "UNMET DEP" in its tree structure(run npm list -g to see the full depth of each global package), meaning its subdependencies are missing.
I solved by reinstalling each global package. If you had this problem on Arch Linux,
first check this post: I have unmet dependencies
I had this problem surfaced after I sudo pacman -Syu and I have a bunch of ERROR missing semver and node-pyg.
As a side note, under Arch Linux node-pyg and semver are installed as dependencies before npm is installed through pacman(rather than through npm), and I guess the order these two are installed or updated matters. Probably under other OS or linux distros, these two packages are not listed in the repository.

Resources