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 tarball got ENOTDIR: not a directory error #2045

Closed
dr-js opened this issue Oct 26, 2020 · 3 comments
Closed

[BUG] npm publish tarball got ENOTDIR: not a directory error #2045

dr-js opened this issue Oct 26, 2020 · 3 comments
Assignees
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@dr-js
Copy link
Contributor

dr-js commented Oct 26, 2020

Current Behavior:

With command like npm publish /path/to/tarball/from/npm-pack.tgz, npm will error with:

$ npm publish ./dr-js-core-0.4.0-dev.8.tgz
npm ERR! code ENOTDIR
npm ERR! syscall open
npm ERR! path ./dr-js-core-0.4.0-dev.8.tgz/package.json
npm ERR! errno -20
npm ERR! ENOTDIR: not a directory, open './dr-js-core-0.4.0-dev.8.tgz/package.json'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dr/.npm/_logs/2020-10-26T08_40_37_321Z-debug.log

And the log file:

[/home/dr/.npm/_logs/2020-10-26T08_40_37_321Z-debug.log]
0 verbose cli [
0 verbose cli   '/usr/bin/node',
0 verbose cli   '/usr/bin/npm',
0 verbose cli   'publish',
0 verbose cli   './dr-js-core-0.4.0-dev.8.tgz'
0 verbose cli ]
1 info using npm@7.0.5
2 info using node@v15.0.1
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 2ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/home/dr/Git/dr-js/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/home/dr/.npmrc Completed in 2ms
11 timing config:load:user Completed in 2ms
12 timing config:load:file:/usr/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 3ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 12ms
19 verbose npm-session 27bc3b1b0c2cde0a
20 timing npm:load Completed in 23ms
21 verbose publish [ './dr-js-core-0.4.0-dev.8.tgz' ]
22 timing command:publish Completed in 20ms
23 verbose stack Error: ENOTDIR: not a directory, open './dr-js-core-0.4.0-dev.8.tgz/package.json'
24 verbose cwd /home/dr/Git/dr-js
25 verbose Linux 5.9.1-arch1-1
26 verbose argv "/usr/bin/node" "/usr/bin/npm" "publish" "./dr-js-core-0.4.0-dev.8.tgz"
27 verbose node v15.0.1
28 verbose npm  v7.0.5
29 error code ENOTDIR
30 error syscall open
31 error path ./dr-js-core-0.4.0-dev.8.tgz/package.json
32 error errno -20
33 error ENOTDIR: not a directory, open './dr-js-core-0.4.0-dev.8.tgz/package.json'
34 verbose exit -20

Expected Behavior:

Should just publish the tarball, currently npm seem to think this is a folder to run npm pack with.

Steps To Reproduce:

Should be able to test with:

mkdir -p ./test-npm-publish
cd ./test-npm-publish
npm init --yes
npm pack
npm publish test-npm-publish-1.0.0.tgz

Environment:

25 verbose Linux 5.9.1-arch1-1
27 verbose node v15.0.1
28 verbose npm  v7.0.5
@dr-js dr-js 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 Oct 26, 2020
@dr-js
Copy link
Contributor Author

dr-js commented Oct 26, 2020

The current walkaround is switch back and publish with npm@6:

npm i -g npm@6

or use npx as a manual temp fix:

npx npm@6 publish ./dr-js-core-0.4.0-dev.8.tgz --tag dev --access public

Both are tested and should work.

@isaacs
Copy link
Contributor

isaacs commented Oct 26, 2020

This was something we intentionally dropped support for, but not for any strong principled reason, just that we weren't sure anyone was using it. Happy to bring support for that back, since I have some other small fixes to do in libnpmpublish anyway.

@isaacs isaacs self-assigned this Oct 26, 2020
@isaacs isaacs removed the Needs Triage needs review for next steps label Oct 26, 2020
@isaacs
Copy link
Contributor

isaacs commented Nov 17, 2020

This was fixed pretty recently, please try again in the latest release.

@isaacs isaacs closed this as completed Nov 17, 2020
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

No branches or pull requests

2 participants