That all works, but when I add a package:
npm install --save rxjs
Then import that package in index.ts:
import {Observable} from "rxjs";
let observable = new Observable();
Then build again npm run build
The build step completes, but when I try to load the script through python I'm getting this error:
Traceback (most recent call last):
File "/home/myles/frida-agent-example/frida-gadget-main.py", line 13, in <module>
main()
File "/home/myles/frida-agent-example/frida-gadget-main.py", line 10, in main
script: frida.core.Script = sess.create_script(script_path.read_text())
File "/home/myles/frida-agent-example/venv/lib/python3.10/site-packages/frida/core.py", line 86, in wrapper
return f(*args, **kwargs)
File "/home/myles/frida-agent-example/venv/lib/python3.10/site-packages/frida/core.py", line 628, in create_script
return Script(self._impl.create_script(source, **kwargs)) # type: ignore
frida.InvalidArgumentError: could not load module '/node_modules/rxjs/dist/esm5/internal/Observable'
Any ideas on what I'm doing wrong here? How can I get it to pick up imports from node_modules?
I'm using typescript for a frida module that's being loaded on Android.
Reproduction steps:
git clone https://github.com/oleavr/frida-agent-example.git
cd frida-agent-example
npm install
npm run build
Create this python file:
That all works, but when I add a package:
npm install --save rxjs
Then import that package inindex.ts
:Then build again
npm run build
The build step completes, but when I try to load the script through python I'm getting this error:Any ideas on what I'm doing wrong here? How can I get it to pick up imports from
node_modules
?