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();
(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.
What / Why
my code:
result:
Where