Programing

npm : "0.1"버전이 잘못된 이유는 무엇입니까?

lottogame 2020. 9. 25. 08:12
반응형

npm : "0.1"버전이 잘못된 이유는 무엇입니까?


npm이이 작업을 수행하지 않도록 내 npm 앱의 버전을 0.1에서 0.0.1로 변경해야했습니다.

$ npm install
npm ERR! install Couldn't read dependencies
npm ERR! Error: invalid version: 0.1
npm ERR!     at validVersion (/usr/local/Cellar/node/0.10.5/lib/node_modules/npm/node_modul
es/read-package-json/read-json.js:571:40)
npm ERR!     at final (/usr/local/Cellar/node/0.10.5/lib/node_modules/npm/node_modules/read
-package-json/read-json.js:323:23)
npm ERR!     at /usr/local/Cellar/node/0.10.5/lib/node_modules/npm/node_modules/read-packag
e-json/read-json.js:139:33
npm ERR!     at cb (/usr/local/Cellar/node/0.10.5/lib/node_modules/npm/node_modules/slide/l
ib/async-map.js:48:11)
npm ERR!     at /usr/local/Cellar/node/0.10.5/lib/node_modules/npm/node_modules/read-packag
e-json/read-json.js:301:48
npm ERR!     at fs.js:207:20
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 12.3.0
npm ERR! command "/usr/local/Cellar/node/0.10.5/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/lust/Documents/ply/dev-server
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/lust/Documents/ply/dev-server/npm-debug.log
npm ERR! not ok code 0

완전성을 위해 여기에 작동하는 json이 있습니다.

$ cat package.json
{
    "name": "ply",
    "description": "ply server for local dev testing deployments",
    "version": "0.0.1",
    "private": true,
    "dependencies": {
        "express": "3.x"
    }
} 

오류가 발생했을 때 버전은 "0.1"이었습니다.

3 세트의 버전 번호가 필요한 일종의 API / ABI 호환성 버전 관리 개념입니까? 오류 메시지가 더 친숙하지 않은 이유는 무엇입니까?


예, 이것은 npm 패키지가 사용하는 버전 관리 체계 인 의미 체계 버전 관리에 필요 합니다. 다음은 의 스 니펫입니다npm help json .

버전은 종속성으로 npm과 함께 번들로 제공 되는 node-semver 에서 구문 분석 할 수 있어야합니다 . ( npm install semver직접 사용하십시오.)

다음은 npm의 semver 구현이 semver.org에있는 것과 어떻게 다른지 보여줍니다.

  • 버전은 "v"로 시작할 수 있습니다.
  • A numeric item separated from the main three-number version by a hyphen will be interpreted as a "build" number, and will increase the version. But, if the tag is not a number separated by a hyphen, then it's treated as a pre-release tag, and is less than the version without a tag. So, 0.1.2-7 > 0.1.2-7-beta > 0.1.2-6 > 0.1.2 > 0.1.2beta

So yea, the short answer is "You need to use semantic versioning"

But the reasoning behind that is to provide a sensible, uniform package version to all users of npm. When getting a version number of an package, you have some level of confidence that the author understands semver and is employing it properly.


Simple answer:

If you want to use package version, let's say '0.1', but keep getting the warning Invalid version: "0.1", then just change it to '0.1.0'. Done.

참고URL : https://stackoverflow.com/questions/16887993/npm-why-is-a-version-0-1-invalid

반응형