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] Failed to decode path name with valid symbols #193

Open
1 task done
andrew-aladjev opened this issue Sep 12, 2024 · 1 comment
Open
1 task done

[BUG] Failed to decode path name with valid symbols #193

andrew-aladjev opened this issue Sep 12, 2024 · 1 comment
Labels
Bug thing that needs fixing Needs Triage needs an initial review

Comments

@andrew-aladjev
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Parent issue: npm/cli#7779

cd /tmp
mkdir ' !"$%&'\''()*+,-.0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
cd ' !"$%&'\''()*+,-.0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'
npm pack
4 silly config load:file:/tmp/ !"$%&'()*+,-.0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~/.npmrc
5 silly config load:file:/home/puchuu/.npmrc
6 silly config load:file:/home/puchuu/.local/share/fnm/node-versions/v20.16.0/installation/etc/npmrc
7 verbose title npm pack
8 verbose argv "pack"
9 verbose logfile logs-max:10 dir:/home/puchuu/.npm/_logs/2024-09-12T12_18_03_676Z-
10 verbose logfile /home/puchuu/.npm/_logs/2024-09-12T12_18_03_676Z-debug-0.log
11 silly logfile start cleaning logs, removing 1 files
12 verbose stack URIError: URI malformed
12 verbose stack     at decodeURIComponent (<anonymous>)
12 verbose stack     at fromFile (/home/puchuu/.local/share/fnm/node-versions/v20.16.0/installation/lib/node_modules/npm/node_modules/npm-package-arg/lib/npa.js:279:22)

It is not possible to work with symbols available in path with URI. I don't know why you are trying to use URI encode and decode.

Expected Behavior

No response

Steps To Reproduce

No response

Environment

  • npm: 10.8.1
  • Node: v20.16.0
  • OS: Ubuntu 24.04.1 LTS
@andrew-aladjev andrew-aladjev added Bug thing that needs fixing Needs Triage needs an initial review labels Sep 12, 2024
@andrew-aladjev andrew-aladjev changed the title [BUG] Failed to decode path names with valid symbols [BUG] Failed to decode path name with valid symbols for path Sep 12, 2024
@andrew-aladjev andrew-aladjev changed the title [BUG] Failed to decode path name with valid symbols for path [BUG] Failed to decode path name with valid symbols Sep 12, 2024
@andrew-aladjev
Copy link
Author

Can you please describe what does let resolvedPath = decodeURIComponent(resolvedUrl.pathname) mean? pathname can include any ascii symbol except / and it can't be decoded using decodeURIComponent. Why are you using decodeURIComponent here?

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 an initial review
Projects
None yet
Development

No branches or pull requests

1 participant