I am trying to set up an npm repository and trying to publish a new package to it.
I have read the documentation at https://docs.gitea.com/usage/packages/npm and have configured the new package source and set up an access token.
I run ‘npm publish’ from my node project directory and I get E404 File Not Found ‘Simple-node-test@1.0.0’ is not in this registry. I know it is not in the registry as I am trying to publish to it. What step have I missed?
I am running gitea version 1.22.2 as a local server on my Ubunut PC and using npm version 10.4.0.
I have a single user that has an organisation ‘Test’ that has a ‘simple-node-test’ git repository with the simple node project files and currently no packages.
I have set up under the user->settings->applications->Manage Access Token an access token with access to All repository & Organisations with All permissions (read write permissions to everything on the list).
My .npmrc file is
> registry="http://localhost:3000/api/v1/packages/Test/npm/"
> //localhost:3000/api/v1/packages/Test/npm/:_authToken=.......89f683f6
The Gitea Log output is
> ...eb/routing/logger.go:102:func1() [I] router: completed PUT /api/v1/packages/Test/npm/simple-node-test for 127.0.0.1:50820, 404 Not Found in 19.7ms @ http/server.go:2188(GlobalNotFound)
My node package.json is
> {
> "name": "simple-node-test",
> "version": "1.0.0",
> "description": "A simple Node Project",
> "main": "src/index.js",
> "scripts": {
> "test": "jest"
> },
> "author": "jeff",
> "license": "MIT",
> "devDependencies": {
> "jest": "^29.7.0"
> }
> }
My src/index.js is
> console.log("Hello world");