-
Notifications
You must be signed in to change notification settings - Fork 231
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
Cannot find module '../build/Debug/pty.node' #256
Comments
What's the output of the npm install? |
|
Strange, node-pty definitely works under Electron as VS Code has early builds working and the terminal works. Doesn't look like any node-pty-specific changes in the diff https://github.com/Microsoft/vscode/compare/electron-4.0.x |
FYI if I try to use https://github.com/Microsoft/node-pty/tree/master/examples/electron with
and do
I get in electron dev tools
|
Maybe this is the problem? it's only be tested on <= node 10? |
I had the same problem. I was seeing errors about "Cannot find module '../build/Debug/pty.node'. It turns out that in my case, the error message is misleading. The code that loads the DLL (see the file utils.js in the node-pty code) actually found the Release version of the DLL, but couldn't load it because it was compiled with the wrong version of node. It did not report that error.. So the code went on to try loading the Debug version of the DLL, which did not exist, and that's the error message I saw. Once I figured that out, the next step was to recompile node-pty with the latest node version. So I deleted my node_modules directory and ran "yarn". Surprisingly to me, that didn't fix the problem. After much Googling, I did this ... npm rebuild node-pty --update-binary and all was well. I don't know where the old DLL was being stashed such that it wasn't deleted when I deleted my node_modules directory. Can someone tell me? |
Same problem, I get this error :
And when I try to reinstall packages I get this:
I tried with node latest v8 and latest v10. It started happening just a few days ago, not sure when exactly. I tried updainig macos command line tools to the latest available version and I am on macos 10.13.6 |
I solved the error. npm install --save-dev electron-rebuild add a script in package.json "scripts": {
"rebuild": "electron-rebuild -f -w node-pty"
} then npm run rebuild |
@haofo would this do the same as |
@Tyriar the error i run into was due to the electron version did not match in my project.
when I downloaded |
Double check your installed electron version. npm might install |
So I think this is all related to not compiling with Electron's version of node or webpack not knowing about the .node file. These are both by design, feel free to propose a change to the documentation to make these issues more visible though. |
I am running into this error on my project and am not sure what the solution is here? I've tried |
You can comment out the try/catch and debug import to see the actual error, created #326 to improve the error you get. |
This happened to me when running karma tests. Unrelated, but my project migrated to jest and I just made a mock for the module. Solved the problem. |
Upgrading to latest node-pty beta (0.9.0-beta27) and rebuilding electron via electron-rebuild ( |
@Tyriar Not sure if its worth creating a new issue but mine is identical to the two logs provided. I lowered my node version, still to no avail: node-pty -v 0.9.0 OS: Ubuntu 19.10 |
This is a generic error that importing failed, in 0.9.0 the original release exception is re-thrown which should give more information: #340 You can create a new issue if it's not obvious from the error message. |
Environment details
Issue description
The text was updated successfully, but these errors were encountered: