Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
npm publish fails with "The "path" argument must be of type string. Received undefined"

I have a project that i publish on a private npm repository. Under node v14.16.0 (npm v6.14.11), the command npm publish run well and my package is published on my private repository.

I upgraded npm to 7 to support peer dependencies installation. Now under node v15.12.0 (npm v7.6.3), the command npm publish fails with

The "path" argument must be of type string. Received undefined

Any idea?

Update

npm 7.6.3 with node 14 as the same effect :

The "path" argument must be of type string

Update 2

console output with flag --verbose

npm verb cli [ npm verb cli
'.nvm/versions/node/v15.12.0/bin/node', npm verb cli
'.nvm/versions/node/v15.12.0/bin/npm', npm verb cli 'publish', npm verb cli '--verbose' npm verb cli ] npm info using npm@7.6.3 npm info using node@v15.12.0 npm timing config:load:defaults Completed in 3ms npm timing config:load:file:.nvm/versions/node/v15.12.0/lib/node_modules/npm/npmrc Completed in 2ms npm timing config:load:builtin Completed in 2ms npm timing config:load:cli Completed in 2ms npm timing config:load:env Completed in 0ms npm timing config:load:file:MyProject/.npmrc Completed in 4ms npm timing config:load:project Completed in 5ms npm timing config:load:file:.npmrc Completed in 4ms npm timing config:load:user Completed in 4ms npm timing config:load:file:.nvm/versions/node/v15.12.0/etc/npmrc Completed in 1ms npm timing config:load:global Completed in 1ms npm timing config:load:cafile Completed in 0ms npm timing config:load:validate Completed in 0ms npm timing config:load:setUserAgent Completed in 1ms npm timing config:load:setEnvs Completed in 0ms npm timing config:load Completed in 18ms npm verb npm-session 83e5ee6d9b1b9659 npm timing npm:load Completed in 82ms npm verb publish [ '.' ] npm timing command:publish Completed in 25ms npm verb stack TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined npm verb stack at new NodeError (node:internal/errors:329:5) npm verb stack at validateString (node:internal/validators:129:11) npm verb stack
at join (node:path:1081:7) npm verb stack at flatten (.nvm/versions/node/v15.12.0/lib/node_modules/npm/lib/utils/flat-options.js:50:10) npm verb stack at Publish.publishConfigToOpts (.nvm/versions/node/v15.12.0/lib/node_modules/npm/lib/publish.js:140:12) npm verb stack at Publish.publish (.nvm/versions/node/v15.12.0/lib/node_modules/npm/lib/publish.js:58:32)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I found the issue here

The workaround is to add a cache property to the publishConfig section of package.json

"publishConfig": {
    "cache": "cache/.npm",
    "registry": "https://mydomain/myrepo"
}

Update

The issue has been fixed in npm 7.7.0

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!