When try to change the extension to .ts on all .js files in app/admin folder using this command
renamer --find '.js' --replace '.ts' 'app/admin/**/*.js'
I got this error
/usr/lib/node_modules/renamer/bin/cli.mjs:2
import CliApp from '../lib/cli-app.mjs'
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
before running this command run:
npm i -g renamer
I want to convert those js files to ts files because try to migrate an AngularJS application to Angular12. If you know any solution for this error please tell me.