2018-10-25 20:29:56 +02:00
---
id: 587d7fb4367417b2b2512bff
title: Add a Version to Your package.json
challengeType: 2
2019-08-05 09:17:33 -07:00
forumTopicId: 301525
2018-10-25 20:29:56 +02:00
---
## Description
<section id='description'>
2019-03-03 12:30:44 -06:00
A <code>version</code> is one of the required fields of your package.json file. This field describes the current version of your project. Here's an example:
2019-05-14 05:00:06 -07:00
```json
2019-05-17 21:37:16 +05:30
"version": "1.2.0",
2019-05-14 05:00:06 -07:00
```
2018-10-25 20:29:56 +02:00
</section>
## Instructions
<section id='instructions'>
2019-03-03 12:30:44 -06:00
Add a <code>version</code> to the package.json file of your project.
2018-10-25 20:29:56 +02:00
</section>
## Tests
<section id='tests'>
```yml
2018-10-27 12:53:05 +03:00
tests:
- text: package.json should have a valid "version" key
testString: 'getUserInput => $.get(getUserInput(''url'') + ''/_api/package.json'').then(data => { var packJson = JSON.parse(data); assert(packJson.version, ''"version" is missing''); }, xhr => { throw new Error(xhr.responseText); })'
2018-10-25 20:29:56 +02:00
```
</section>
## Challenge Seed
<section id='challengeSeed'>
</section>
## Solution
<section id='solution'>
```js
2019-10-24 10:08:13 +05:30
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/
2018-10-25 20:29:56 +02:00
```
2019-07-18 08:24:12 -07:00
2018-10-25 20:29:56 +02:00
</section>