سؤال

I created a very basic package.json and running npm install is throwing version error.

Erroneous package.json

{
    "name": "appone",
    "description": "First CNP app",
    "version": "1.0",
    "dependencies": {
        "express": "3.x"
    }
}

However on changing the version from 1.0 to 0.0.1 it is working correctly.

I am new to node so I thought this version refers to the app version so I can give this any number. Please let me know what actually it is referring to and about the error.

هل كانت مفيدة؟

المحلول

Well, you can link-hop from the package.json documentation to the node-semver doc to http://semver.org/, but the gist is, valid version strings must have a MAJOR version, a MINOR version, and a PATCH version:

major.minor.patch

So 1.0 is not valid because it doesn't have a patch version. 1.0.0 would be acceptable.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top