I am trying to publish a package that I made. Here is a link to the files Github Repo. For some reason it is just hung. When I do npm publish
I just get a cursor. There is no errors or output of any kind. I have tried doing an npm login
and also npm adduser
both have me logged in successfully. So I did npm publish --verbose
and here is the output.
PS D:DevelopmentProjectsscrollpropackage> npm publish --verbose
npm verb cli C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmbinnpm-cli.js
npm info using [email protected]
npm info using [email protected]
npm verb title npm publish
npm verb argv "publish" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:C:UsersWamoAppDataLocalnpm-cache_logs2023-04-18T03_59_42_589Z-
npm verb logfile C:UsersWamoAppDataLocalnpm-cache_logs2023-04-18T03_59_42_589Z-debug-0.log
npm verb publish [ '.' ]
and here is the contents of the log file:
0 verbose cli C:Program Filesnodejsnode.exe C:Program Filesnodejsnode_modulesnpmbinnpm-cli.js
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:Program Filesnodejsnode_modulesnpmnpmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:D:DevelopmentProjectsscrollpropackage.npmrc Completed in 1ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:UsersWamo.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:UsersWamoAppDataRoamingnpmetcnpmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 1ms
16 timing config:load Completed in 6ms
17 timing npm:load:configload Completed in 6ms
18 timing npm:load:mkdirpcache Completed in 0ms
19 timing npm:load:mkdirplogs Completed in 0ms
20 verbose title npm publish
21 verbose argv "publish" "--loglevel" "verbose"
22 timing npm:load:setTitle Completed in 1ms
23 timing config:load:flatten Completed in 2ms
24 timing npm:load:display Completed in 5ms
25 verbose logfile logs-max:10 dir:C:UsersWamoAppDataLocalnpm-cache_logs2023-04-18T03_59_42_589Z-
26 verbose logfile C:UsersWamoAppDataLocalnpm-cache_logs2023-04-18T03_59_42_589Z-debug-0.log
27 timing npm:load:logFile Completed in 4ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 18ms
31 verbose publish [ '.' ]
32 silly logfile start cleaning logs, removing 2 files
33 silly logfile done cleaning log files
I don’t see any errors here. And I am just stuck and I have no idea what is going on.
I have other packages that I have published in the past so I went to one of them and changed the version and tried publishing it and that worked just fine. So then I just created a blank package and tried to publish that which worked just fine. So I have no idea what is going on. The package I’m trying to publish is a little larger but still isn’t that big but I figured maybe it would take a little longer so I let it sit for an hour and still nothing. Maybe there is something small I am missing here.
Any help here would really be appreciated because this is driving me crazy.
2
Answers
So it was apparently the prepare statement in
package.json
. I was runningnpm run build
in that statement and the build script istsc --project tsconfig.build.json
. In mytsconfig.json
file I am settingwatch: true
. This was apparently causing a continuous running build script not allowing the actual publishing part to happen. So I removed thewatch: true
from my my config and just put the-w
flag in thepackage.json
build script. Then in my prepare script I am just doing the build without the watch flag and it works now. Here is how the scripts look in the revisedpackage.json
Try to:
1 – Check .gitignore and .npmignore files for unintentionally ignored files.
2 – Verify the name, version, main of your package.json.
3 – Exclude unnecessary or large files using .npmignore.
4 – Clear the npm cache with
npm cache clean --force
and try publishing again.5 – Update npm and Node.js to their latest stable versions.
This is the docs, https://docs.npmjs.com/cli/v8/commands/npm-publish