# Uploading npm snapshots results in java.lang.NumberFormatException: For input string: "20221105141116"

**URL:** <https://community.sonatype.com/t/uploading-npm-snapshots-results-in-java-lang-numberformatexception-for-input-string-20221105141116/9563>\
**Category:** Sonatype Nexus Repository\
**Tags:** nexus-repository, npm\
**Created:** [November 7, 2022, 7:22am UTC](https://community.sonatype.com/t/uploading-npm-snapshots-results-in-java-lang-numberformatexception-for-input-string-20221105141116/9563 "2022-11-07T07:22:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![g.rosso](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/g.rosso/32/1618_2.png) [@g.rosso](https://community.sonatype.com/u/g.rosso)\
**Post date:** [November 7, 2022, 7:22am UTC](https://community.sonatype.com/t/uploading-npm-snapshots-results-in-java-lang-numberformatexception-for-input-string-20221105141116/9563/1 "2022-11-07T07:22:20Z")

</div>

Good morning,  
after upgrading from 3.40 to 3.42, we are not able to upload npm artifacts (snapshots) to Nexus OSS hosted repo.  
_npm publish_ creates an artifact with version number as _1.0.0-test.20221105141116.1273f29_, with the following:

- version number (1.0.0)
- environment (test)
- timestamp (20221105141116)
- short commit id (1273f29)

This is what we get after execution:

```auto
npm publish
npm notice 
npm notice package: web-collaboration-client@1.0.0-test.20221105141116.1273f29
npm notice === Tarball Contents === 
npm notice 42B build/.version                                            
npm notice 3.4kB build/orchestrator/web-collaboration-client.css           
npm notice 3.4kB build/web-collaboration-client.css                        
npm notice 3.6kB build/index.html                                          
npm notice 3.6kB build/orchestrator/index.html                             
npm notice 243.6kB build/orchestrator/web-collaboration-client.js            
npm notice 1.5MB build/web-collaboration-client.js                         
npm notice 2.7kB package.json                                              
npm notice 5.5kB build/orchestrator/web-collaboration-client.css.map       
npm notice 5.5kB build/web-collaboration-client.css.map                    
npm notice 619.8kB build/orchestrator/web-collaboration-client.js.map        
npm notice 3.8MB build/web-collaboration-client.js.map                     
npm notice 494B build/orchestrator/web-collaboration-client.js.LICENSE.txt
npm notice 2.4kB build/web-collaboration-client.js.LICENSE.txt             
npm notice === Tarball Details === 
npm notice name: web-collaboration-client                
npm notice version: 1.0.0-test.20221105141116.1273f29       
npm notice package size: 1.5 MB                                  
npm notice unpacked size: 6.1 MB                                  
npm notice shasum: 3354ba0f1d0c4497b087348038c8012ea9d45801
npm notice integrity: sha512-TuY/+yHFB9bmg[...]4mkfQ41FFF2JA==
npm notice total files: 14                                      
npm notice 
npm ERR! code E400
npm ERR! 400 Bad Request - PUT https://nexusrepo.example.com/nexus/repository/react-private-snapshots/web-collaboration-client - For input string: "20221105141116"

```

Nexus OSS throws a java exception:

```auto
2022-11-05 15:12:06,589+0100 WARN [qtp580124277-536] jenkins-user com.sonatype.nexus.repository.npm.internal.NpmHandlers - Error: PUT /web-collaboration-client: Status{successful=false, code=400, message='null'} - For input string: "20221105141116"
java.lang.NumberFormatException: For input string: "20221105141116"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:583)
        at java.lang.Integer.valueOf(Integer.java:766)
        at com.sonatype.nexus.repository.npm.internal.NpmFormatAttributesExtractor.getSearchNormalizedVersion(NpmFormatAttributesExtractor.java:297)

```

From what I see, it seems nexus has an internal format validator, expecting the version to be _normalized_, but I cannot find anything in documentation nor online.  
Is there a way to find how to format version field?

Thank you very much.

Giancarlo

---

<div class="post-metadata">

**Author:** ![g.rosso](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/g.rosso/32/1618_2.png) [@g.rosso](https://community.sonatype.com/u/g.rosso)\
**Post date:** [November 7, 2022, 8:18am UTC](https://community.sonatype.com/t/uploading-npm-snapshots-results-in-java-lang-numberformatexception-for-input-string-20221105141116/9563/2 "2022-11-07T08:18:10Z")

</div>

Hi all,  
I found the same issue on Jira: [[NEXUS-35486] Unable to Upload npm package with long buildnumber - Sonatype JIRA](https://issues.sonatype.org/browse/NEXUS-35486)
