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 failed, file not found #7853

Closed
2 tasks done
bp-adipsys opened this issue Oct 18, 2024 · 8 comments
Closed
2 tasks done

[BUG] Npm publish failed, file not found #7853

bp-adipsys opened this issue Oct 18, 2024 · 8 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@bp-adipsys
Copy link

bp-adipsys commented Oct 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Since the update, when i trying to publish my package to a private repository (gitlab package registry) i got an error.

I tried with 3 environements :

  • Local computer : npm 10.8.3 & node 22.9.0 => no errors
  • Local computer : npm 10.9.0 & node 23.0.0 => error enoent ENOENT: no such file or directory, open 'C:\User\workspace\README.md'
  • Gitlab jog : npm 10.9.0 & node 23.0.0 => error enoent ENOENT: no such file or directory, open 'C:\User\workspace\README.md'

The path seems incorrect because the file path is : C:\User\workspace\project\README.md

There is a new warning with v10.9.0 but it's not related to the issue i think :
(node:48612) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time

Expected Behavior

There are no errors with previous version : 10.8.3 & node 22.9.0 and the package is published to our private repository.

Steps To Reproduce

Build a librairy and try to publish it on a repository, our is a gitlab package registry.

Environment

  • npm: 10.9.0
  • Node.js: 23.0.0
  • OS Name: Windows 11 / Gitlab
@bp-adipsys bp-adipsys added Bug thing that needs fixing Needs Triage needs review for next steps labels Oct 18, 2024
@jkoenig134
Copy link

Same issue on Mac and Linux (pipeline on GitHub Actions), both at node 23.
Additionally I can also reproduce this with older npm versions.

@milaninfy
Copy link
Contributor

This might be related to node js 23..
Can you try with npm 10.9.0 with different version of node ?

I am able to reproduce similer error with node 23 whereas node 22.9.0 with npm 10.9.0 works as expected.

~/workarea/rep/test/test2 $ nvm use 22.9
Now using node v22.9.0 (npm v10.9.0)
~/workarea/rep/test/test2 $ npm publish --registry=http://localhost:4873
npm notice
npm notice 📦  milan-test-publish@3.0.0
npm notice Tarball Contents
npm notice 19B dist/index.js
npm notice 57B package.json
npm notice Tarball Details
npm notice name: milan-test-publish
npm notice version: 3.0.0
npm notice filename: milan-test-publish-3.0.0.tgz
npm notice package size: 198 B
npm notice unpacked size: 76 B
npm notice shasum: 269937c292086c079b8d330da32be9130a8a3d47
npm notice integrity: sha512-7Rjh1V9nWZRNl[...]dJTlpDJd6KmDA==
npm notice total files: 2
npm notice
npm notice Publishing to http://localhost:4873/ with tag latest and default access
+ milan-test-publish@3.0.0
~/workarea/rep/test/test2 $ nvm use 23
Now using node v23.0.0 (npm v10.9.0)
~/workarea/rep/test/test2 $ npm version minor
v3.1.0
~/workarea/rep/test/test2 $ npm publish --registry=http://localhost:4873
(node:8975) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
npm warn tarball tarball data for file:/Users/milaninfy/workarea/rep/test/test2/ (null) seems to be corrupted. Trying again.
npm warn tarball tarball data for file:/Users/milaninfy/workarea/rep/test/test2/ (null) seems to be corrupted. Trying again.
npm error code ENOENT
npm error syscall lstat
npm error path /Users/milaninfy/workarea/rep/test/test2/ist/index.js
npm error errno -2
npm error enoent ENOENT: no such file or directory, lstat '/Users/milaninfy/workarea/rep/test/test2/ist/index.js'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: /Users/milaninfy/.npm/_logs/2024-10-18T13_08_38_125Z-debug-0.log

@milaninfy
Copy link
Contributor

This issue might be related to nodejs/node#55410

@bp-adipsys
Copy link
Author

Node 22.9.0 / 22.10.0 works, so it's related to node 23.0.0

@jkoenig134
Copy link

jkoenig134 commented Oct 18, 2024

Can you try with npm 10.9.0 with different version of node ?

yes, works for me.

@milaninfy
Copy link
Contributor

Closing this as it's not npm-cli issue.

@milaninfy milaninfy closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2024
@doni108108doni doni108108doni mentioned this issue Oct 19, 2024
2 tasks
@bp-adipsys
Copy link
Author

Bug resolved, tested with nightly/v24.0.0-nightly20241022e4ca097f56

@Mo0rBy
Copy link

Mo0rBy commented Oct 29, 2024

I can confirm this is fixed in Node v23.1.0, so there is no need to use nightly anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

4 participants