facebook / jscodeshift

A JavaScript codemod toolkit.
https://jscodeshift.com
MIT License
9.26k stars 477 forks source link

Can't see file in current working directory - "Skipping path which does not exist." #554

Open xelfer opened 1 year ago

xelfer commented 1 year ago

As per my issue at awslabs/aws-sdk-js-codemod#478 I'm unable to run jscodeshift on a file in my current working directory without providing the full path. The error says the file does not exist.

nick@nbp src % ls -la input.js
-rw-r--r--  1 nick  staff  43 Mar 23 09:56 input.js
nick@nbp src % npx jscodeshift -t ~/.npm/_npx/c10ddf24489924c3/node_modules/aws-sdk-js-codemod/dist/transforms/v2-to-v3/transformer.js input.js
Need to install the following packages:
  jscodeshift@0.14.0
Ok to proceed? (y) y
Skipping path input.js which does not exist. 
No files selected, nothing to do. 
All done. 
Results: 
0 errors
0 unmodified
0 skipped
0 ok
Time elapsed: 0.003seconds 
nick@nbp src % npx envinfo --system

  System:
    OS: macOS 13.2.1
    CPU: (10) x64 Apple M1 Max
    Memory: 2.94 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
ElonVolo commented 1 year ago

What happens if you clone the following repository to a non .npm destination (home directory, whatever) and try to run it?

https://github.com/ElonVolo/jscodeshift_litmus

xelfer commented 1 year ago

That appears to work fine

nick@nbp jscodeshift_litmus % pwd
/Users/nick/jscodeshift_litmus
% npx jscodeshift -t transform.js input.js
Processing 1 files... 
Spawning 1 workers...
Sending 1 files to free worker...
All done. 
Results: 
0 errors
0 unmodified
0 skipped
1 ok
Time elapsed: 0.838seconds