npm install fails "invalid version"

the version number can only be like \d+\.\d+\.\d+ so \d+\.\d+.\d+.\d+ is not valid. so "1.0.0.0" is not valid and and "1.0.0" is. But check the link below for a more accurat description. This works:

package.json
{
  "name": "version-sample",
  "version": "1.0.0",
  "dependencies": { 
      "sample" : "*" 
   }
}

The full documentation is located here https://semver.org/ (including a proper regex


"1.0" is not a valid version as defined by Semantic Versioning. Changing it to "1.0.0" should solve your issue.enter image description here

Tags:

Npm