esptool-js icon indicating copy to clipboard operation
esptool-js copied to clipboard

Missing version in package.json

Open dumbasPL opened this issue 3 years ago • 5 comments

The package.json file is very bare bones here and doesn't even have a version number.

version is a required field

Yarn refuses to install packages that do not have a version number specified and just throws a error Can't add "esptool-js": invalid package version undefined.

dumbasPL avatar Sep 22 '22 13:09 dumbasPL

You should be able to add it based on a commit like this

balloob avatar Sep 23 '22 01:09 balloob

You should be able to add it based on a commit like this

well yes and no. This does work with npm, but yarn will refuse to install it

$ yarn init -y
yarn init v1.22.19
warning The yes flag has been set. This will automatically answer yes to all questions, which may have security implications.
success Saved package.json
Done in 0.02s.
$ yarn add github:espressif/esptool-js#0c1b972a05d691c85da23fcc937d91dcf7e283eb
yarn add v1.22.19
info No lockfile found.
[1/4] Resolving packages...
error Can't add "esptool-js": invalid package version undefined.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

and the only reason npm works is because it skips all checks for git repositories

$ npm i github:espressif/esptool-js#0c1b972a05d691c85da23fcc937d91dcf7e283eb
npm WARN skipping integrity check for git dependency ssh://[email protected]/espressif/esptool-js.git

added 3 packages, and audited 4 packages in 1s

The npm documentation specifies the name and version as required fields so the package.json is invalid either way.

A package.json file must contain "name" and "version" fields.

The "name" field contains your package's name, and must be lowercase and one word, and may contain hyphens and underscores.

The "version" field must be in the form x.x.x and follow the semantic versioning guidelines.

(source)

dumbasPL avatar Sep 23 '22 07:09 dumbasPL

Want to open a PR and add version 0.1 to it?

CC @adwait-esp

balloob avatar Sep 23 '22 13:09 balloob

Want to open a PR and add version 0.1 to it?

done

Edit: On a side note, publishing this package to npmjs.com would also be welcome. This will drastically reduce download times(compared to using git) and will make version management easier

dumbasPL avatar Sep 23 '22 14:09 dumbasPL

bump

dumbasPL avatar Oct 24 '22 08:10 dumbasPL