Skip to content

[QUESTION](libnpmpublish) 404 Not Found  #4250

@lake2

Description

@lake2

What / Why

my code:

const lib = require('libnpmpublish');
const pack = require('libnpmpack');
const path = require('path');

const resolve = (...str) => path.resolve(__dirname, ...str);

const pkg = require(resolve('./dist/package.json'));

async function run() {
    const tarball = await pack(resolve('./dist/'));

    await lib.publish(pkg, tarball, {
        access: true,
        token: 'XXX',
    });
}

run();

result:

(node:22460) UnhandledPromiseRejectionWarning: HttpErrorGeneral: 404 Not Found - PUT https://registry.npmjs.org/@sqlflow%2ftest - Not found
    at D:\VS Code\sqlflow_frontend\package\node_modules\npm-registry-fetch\check-response.js:134:15
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.publish (D:\VS Code\sqlflow_frontend\package\node_modules\libnpmpublish\publish.js:43:12)
    at async run (D:\VS Code\sqlflow_frontend\package\publish\index.js:12:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:22460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:22460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Where

Metadata

Metadata

Assignees

No one assigned

    Labels

    ws:libnpmpublishRelated to the libnpmpublish workspace.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions