Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm publish under node 15.12.0 throws TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string #2893

Closed
jsg2021 opened this issue Mar 18, 2021 · 5 comments
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@jsg2021
Copy link

jsg2021 commented Mar 18, 2021

Current Behavior:

publishing throws an error

Expected Behavior:

publish without error

Steps To Reproduce:

nvm use 15.12.0;
npm publish

0 verbose cli [
0 verbose cli   '/home/jonathan/.nvm/versions/node/v15.12.0/bin/node',
0 verbose cli   '/home/jonathan/.nvm/versions/node/v15.12.0/bin/npm',
0 verbose cli   'publish',
0 verbose cli   '--tag',
0 verbose cli   'alpha'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/home/jonathan/.nvm/versions/node/v15.12.0/lib/node_modules/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:/home/jonathan/Workspace/nti/app/webapp/.npmrc Completed in 2ms
9 timing config:load:project Completed in 2ms
10 timing config:load:file:/home/jonathan/.npmrc Completed in 1ms
11 timing config:load:user Completed in 1ms
12 timing config:load:file:/home/jonathan/.nvm/versions/node/v15.12.0/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 8ms
19 verbose npm-session 58bbfc3072044dcf
20 timing npm:load Completed in 12ms
21 verbose publish [ '.' ]
22 timing command:publish Completed in 19ms
23 verbose stack TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
23 verbose stack     at new NodeError (node:internal/errors:329:5)
23 verbose stack     at validateString (node:internal/validators:129:11)
23 verbose stack     at join (node:path:1081:7)
23 verbose stack     at flatten (/home/jonathan/.nvm/versions/node/v15.12.0/lib/node_modules/npm/lib/utils/flat-options.js:50:10)
23 verbose stack     at Publish.publishConfigToOpts (/home/jonathan/.nvm/versions/node/v15.12.0/lib/node_modules/npm/lib/publish.js:140:12)
23 verbose stack     at Publish.publish (/home/jonathan/.nvm/versions/node/v15.12.0/lib/node_modules/npm/lib/publish.js:58:32)
24 verbose cwd /home/jonathan/Workspace/nti/app/webapp
25 verbose Linux 5.10.23-200.fc33.x86_64
26 verbose argv "/home/jonathan/.nvm/versions/node/v15.12.0/bin/node" "/home/jonathan/.nvm/versions/node/v15.12.0/bin/npm" "publish" "--tag" "alpha"
27 verbose node v15.12.0
28 verbose npm  v7.6.3
29 error code ERR_INVALID_ARG_TYPE
30 error The "path" argument must be of type string. Received undefined
31 verbose exit 1

Environment:

  • OS: Fedora 33
  • Node: 15.12.0
  • npm: 7.6.3
@jsg2021 jsg2021 added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Mar 18, 2021
jsg2021 added a commit to OpenNTI/nti.util.project.scripts that referenced this issue Mar 18, 2021
publishing workflows pin to 15.11 until
npm/cli#2893 is fixed
in an npm version that and comes with node.
@Echron
Copy link

Echron commented Mar 18, 2021

There is a similar ticket for this. At the moment I've fixed it by adding a path to a cache directory in my publish definition in package.json:
"publishConfig": { "cache": "~/.npm", "registry": "*****" },

Duplicate of #2834

@jsg2021
Copy link
Author

jsg2021 commented Mar 18, 2021

i'm not sure it's 100% a duplicate. this package has been fine until ci picked up node 15.12.0

publishConfig just has a registry.
npmrc just has a registry and auth.

@ruyadorno
Copy link
Contributor

@jsg2021 [email protected] is out with the intended fix to the linked issue, can you please check if it fixes yours?

@ruyadorno ruyadorno removed the Needs Triage needs review for next steps label Mar 24, 2021
@jsg2021
Copy link
Author

jsg2021 commented Mar 24, 2021

It does seem to work :)

@jsg2021 jsg2021 closed this as completed Mar 24, 2021
@CodeTroopers
Copy link

I confirm : it works ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants