[SOLVED] " Cannot find module '..\build\Release\pty.node' "


#1

I am using


as a terminal.

The picture relates to
https://github.com/platformio/platformio-atom-ide-terminal/issues/281

I get the warning as seen in the picture. Any idea what to look for?

Thank you.


Terminal inside ATOM
PlatformIO IDE installation hangs in Atom
#2

I use termination and I don’t get that warning.


#3

It sure is an option; one I will investigate.

I will however miss the preset “custom” text that could be pushed to the terminal with a keybinding. I used this to substitute a toggle to run code. Example: python -i tutorial42.py (command & filename).

Thank you for helping me.


#4

Sadly I have a problem there too.
The same problem.

After installing this package, a “red bug” came up.
Pressing on the bug, triggers a request to compile certain modules.
After doing so, it is reported as successfully done so.
Yet the above messages come up.

[no facts, only guessing]
I am wondering… I do not have a C compiler of any sort on my PC - may this be the issue. Atom V1.19 has a built-in ability to compile some stuff - right? Maybe the built-in ability is not enough in this case?

Any thoughts?


#5

In this screenshot, is platformio-ide-terminal disabled?

Packages that require a C compiler are just going to fail to install.


#6

No. Removed - uninstalled.

Is there a way to test this behaviour in V1.20 Beta 1?
I already prepared (unzipped) that version.
Tested it also for proper working: “parallel” V1.19 and V1.20Beta.

However it links back to the user files as used by V1.19. How do I completely uncouple V1.20Beta from V1.19 (stable)?


#7

Here’s the documentation for setting Atom up in portable mode.


#8

Hi.

Thank you for the link.
The question was how to create an instance with no packages.
Allow me to put some ‘meat to the bones’ with what I did.

Creating an empty Beta instance

Steps for a Windows system:

  • The Atom Beta installation files downloaded from here as a single archive file atom-x64-windows.zip.

  • Created a directory C:\Atom Beta

  • Unzipped the atom-x64-windows.zip file in the C:\Atom Beta directory. The unzipped files were placed in C:\Atom Beta\Atom V1.20.

  • The executable can now be reached as C:\Atom Beta\Atom V1.20\atom.exe

  • Another (empty) directory was created within C:\Atom Beta called .atom.
    Directory Tree

  • Creating C:\Atom Beta\.atom is tricky. Windows Explorer does not allow it. So…

  1. Open the command prompt:
    WIN + r
    – ‘cmd’ + enter

  2. In the command prompt:
    a) cd c:\Atom Beta … go to directory
    b) md .atom … create sub directory
    c) exit … close command prompt

  • Start atom.exe from C:\Atom Beta\Atom V1.20\

Atom portable version
Portable Atom and portable PlatformIO install help needed
#9

Now with an ‘empty’ Atom Beta version, I started testing again.
The error I had before of some tree-view issue was not there anymore.
The base Atom V1.20 Beta 1 seems to be working well.

Next I re-installed the termination package.
Result? >>>> Again the same error message as seen in the above pictures.

To be clear: The ..\build\Release\pty.node message not the unrelated tree-view issue.

Next step?


#10

I have no idea. You’ve done a great job of isolating the issue, but I don’t know why it would come up for you when it doesn’t for me. I looked at the most likely culprit, pty.js, and it doesn’t seem like any of the pty.node files are under build/ (there’s not even a Release/), so I’m not sure why it’s complaining about not having it for you. Could it be that your older operating system doesn’t fully support the build process that pty.js needs?


#11

A small question first before I do an expanded reply - do you have a 32-bit or 64-bit installation?

Trying to remember my MS DOS days…

Tree structure image
C:\Atom Beta\.atom\packages\termination\node_modules\pty.js>tree
Folder PATH listing for volume OS
Volume serial number is xxxx-xxxx
C:.
├───bin
│   ├───darwin
│   │   ├───x64_m49
│   │   └───x64_m53
│   ├───linux
│   │   ├───x64_m49
│   │   └───x64_m53
│   └───win32
│       ├───ia32_m49
│       ├───ia32_m53
│       ├───x64_m49
│       └───x64_m53
├───deps
│   └───winpty
│       ├───agent
│       ├───debugserver
│       ├───include
│       ├───libwinpty
│       ├───misc
│       │   └───buffer-tests
│       │       ├───HandleTests
│       │       └───harness
│       ├───shared
│       ├───ship
│       ├───tests
│       └───unix-adapter
├───lib
├───scripts
├───src
│   ├───unix
│   └───win
└───test-windows

I think the problem is with the build not being there. This takes me back to the package being compiled in some way after installation that does not happen for me. Remember when it comes to compilers, I have the minimum-to-none.


#12

64-bit.

Here’s a possibly relevant issue:


#13

The solution is to

  1. cd into the module dir
  2. make clean && node-gyp configure --release && node-gyp build

I didn’t realize node-gyp did this.

Edit: For clarity, this does compile. It just >compiles to ‘…/build/Debug/pty.node’

Please be patient with me. Translate this for me.

  1. cd into the module dir
    I am guessing to change directory into .\node_modules\pty.js

  2. The second part? To which (?)compiler does this belong to? Which compiler do I need to get hold of to be able to run the command quoted command?

OR is there a pre-compiled version available somewhere? Any place particular to look for it?

Thanks.


#14

Correct.

That would be node-gyp, which references whatever C compiler it finds (usually gcc). After doing some looking around, I came to the node-gyp repo and lo and behold (I’ve probably seen it before but completely forgot about it), it seems like Option 1 for Windows is the best way to go. That package, windows-build-tools, dates back to June 12, 2016, so it’s a fairly recent addition to the ecosystem.


#15

:frowning:
Talk about perpetual motion … the wheel keeps on spinning
image

…and woooops - - - 70% of my monthly mobile data capacity is eaten up in the process. This has now officially become a $20 solution for a 10c problem.

I will not be able to continue this solution in this way now.

Thanks for the helpful info though.


#16

Oh, yeah. Wait until you’ve got wifi access before you download anything compiler-oriented. Build tools tend to be relatively large packages because of all the libraries they have to include.


#18

Hello,

Reading today the post
Get user input in Atom while running Ruby script, there was an answer from @ioquatix that had me curious about the promoted package.

From the README.md of the Script Runner Package some interesting detail.

node-gyp failures

If you get issues about loading node-pty, you might have a problem with your python install. node-gyp doesn’t work if python points to python3. To fix this, tell apm to prefer python2.7

apm config set python $(which python2.7)

Once you’ve done this, reinstall script-runner.

I know I have removed Python V2.7 from my system. Up to recently I only had Python V3.6 (ignoring V2.7 installed with Notepad++). I have also seen that the windows-build-tools downloaded Python V2.7 before I interrupted the process. So I thought it was worth try on the BETA version of Atom.

Click for spoiler: It did not work.


DETAIL STEPS
  1. I installed Python V2.7.

  2. (a) The following were the steps in the command line:

C:\Windows\system32>cd C:\Atom Beta\Atom V1.20

C:\Atom Beta\Atom V1.20>cd resources\app\apm\bin

C:\Atom Beta\Atom V1.20\resources\app\apm\bin>apm config set python C:\Python27
  1. (b) Confirmation:
C:\Atom Beta\Atom V1.20\resources\app\apm\bin>apm config get python 
C:\Python27
  1. Untinstall the termination package.

  2. Restart Atom & reinstall the termination package.

  3. Result: No change.

  4. Special note: The package did not request to (?)compile (red bug) as it did the first time I installed it. Not sure how to force this action. Updating dependencies does not change anything either.


What I do know is that Python V3.6 is loaded in my PATH. I am unsure if it will help to point to V2.7 instead. Or perhaps something else to do with the environmental settings. Perhaps…

Before I retry the monster compiler package - will the minimized C compiler (mingw-w64-install.exe) help for my case? How to test?

Some ideas would be welcome.

Regards.

dP


#19

Next…

  1. Change the environmental settings to show to Python V2.7.

  2. Confirm Python version in command prompt:

cmd.exe
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Dan>cd c:\

c:\>cd C:\

c:\>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (
AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

  1. Try to install scipt-runner package to get error response as:
ERROR REPONSE
Installing “script-runner@2.2.1” failed.Hide output…

> node-pty@0.6.10 install C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-8908-1hvku3b.bcnqy6i529\node_modules\script-runner\node_modules\node-pty
> node scripts/install.js


C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-8908-1hvku3b.bcnqy6i529\node_modules\script-runner\node_modules\node-pty>if not defined npm_config_node_gyp (node "C:\Atom Beta\Atom V1.20\resources\app\apm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Atom Beta\Atom V1.20\resources\app\apm\bin\\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 
C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-8908-1hvku3b.bcnqy6i529
`-- (empty)


gyp ERR! configure error 
gyp ERR! stack Error: Python executable "C:\Python36\python.EXE" is v3.6.1, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (C:\Atom Beta\Atom V1.20\resources\app\apm\node_modules\node-gyp\lib\configure.js:454:14)
gyp ERR! stack     at C:\Atom Beta\Atom V1.20\resources\app\apm\node_modules\node-gyp\lib\configure.js:443:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:197:7)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:334:11)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at Socket.emit (events.js:188:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:498:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Atom Beta\\Atom V1.20\\resources\\app\\apm\\bin\\node.exe" "C:\\Atom Beta\\Atom V1.20\\resources\\app\\apm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-8908-1hvku3b.bcnqy6i529\node_modules\script-runner\node_modules\node-pty
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-8908-1hvku3b.bcnqy6i529\package.json'
npm WARN apm-install-dir-117715-8908-1hvku3b.bcnqy6i529 No description
npm WARN apm-install-dir-117715-8908-1hvku3b.bcnqy6i529 No repository field.
npm WARN apm-install-dir-117715-8908-1hvku3b.bcnqy6i529 No README data
npm WARN apm-install-dir-117715-8908-1hvku3b.bcnqy6i529 No license field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Atom Beta\\Atom V1.20\\resources\\app\\apm\\bin\\node.exe" "C:\\Atom Beta\\Atom V1.20\\resources\\app\\apm\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Atom Beta\\.atom\\.apm\\.apmrc" "--userconfig" "C:\\Atom Beta\\.atom\\.apmrc" "install" "C:\\Users\\Dan\\AppData\\Local\\Temp\\d-117715-8908-1oszapu.l0az41jor\\package.tgz" "--runtime=electron" "--target=1.6.9" "--arch=x64" "--global-style" "--msvs_version=2015"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! node-pty@0.6.10 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-pty@0.6.10 install script 'node scripts/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-pty package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-pty
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-pty
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-8908-1hvku3b.bcnqy6i529\npm-debug.log
npm ERR! code 1




From the above error note:

  • Why is the system still linking to Python V3.6?
  • How to force to use Python V2.7 as suggested by:

Python executable “C:\Python36\python.EXE” is v3.6.1, which is not supported by gyp.
You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.

:thinking:


#20

If you got the second error from Atom, I know how that might have happened. If you changed the environment to point to Python 2, that suggests that it may have been pointing at 3 before. If it was pointing at 3 when Atom opened, then Atom will have acquired the environment variable pointing at 3 and be holding on to that. You should try using apm install script-runner from your terminal that says that python is 2.7.


#21

Failed again.
PLUS even though I aim to install for the Beta version it does not do so.
Installing script-runner to C:\Users\Dan\.atom\packages failed

Full report
C:\Atom Beta\Atom V1.20\resources\app\apm\bin>apm install script-runner --python
 c:\python27

Installing script-runner to C:\Users\Dan\.atom\packages failed

> node-pty@0.6.10 install C:\Users\Dan\AppData\Local\Temp\apm-install-dir-11
7715-1032-7s0i7n.1uv44y4x6r\node_modules\script-runner\node_modules\node-pty
> node scripts/install.js


C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-1032-7s0i7n.1uv44y4x6
r\node_modules\script-runner\node_modules\node-pty>if not defined npm_config_nod
e_gyp (node "C:\Atom Beta\Atom V1.20\resources\app\apm\node_modules\npm\bin\node
-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:
\Atom Beta\Atom V1.20\resources\app\apm\bin\\..\node_modules\node-gyp\bin\node-g
yp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-1032-7s0i7n.1uv44y4x6
r\node_modules\script-runner\node_modules\node-pty\build\deps\winpty\src\winpty-
agent.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Defau
lt.props" was not found. Confirm that the path in the <Import> declaration is co
rrect, and that the file exists on disk.
C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-1032-7s0i7n.1uv44y4x6
r\node_modules\script-runner\node_modules\node-pty\build\deps\winpty\src\winpty.
vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.pro
ps" was not found. Confirm that the path in the <Import> declaration is correct,
 and that the file exists on disk.
C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-1032-7s0i7n.1uv44y4x6
r
`-- (empty)


gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Atom Beta\Atom V1.20\resources\app
\apm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:215:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Atom Beta\\Atom V1.20\\resources\\app\\apm\\bin\\node.exe"
 "C:\\Atom Beta\\Atom V1.20\\resources\\app\\apm\\node_modules\\node-gyp\\bin\\n
ode-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-1032-7s0
i7n.1uv44y4x6r\node_modules\script-runner\node_modules\node-pty
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Dan\AppDat
a\Local\Temp\apm-install-dir-117715-1032-7s0i7n.1uv44y4x6r\package.json'
npm WARN apm-install-dir-117715-1032-7s0i7n.1uv44y4x6r No description
npm WARN apm-install-dir-117715-1032-7s0i7n.1uv44y4x6r No repository field.
npm WARN apm-install-dir-117715-1032-7s0i7n.1uv44y4x6r No README data
npm WARN apm-install-dir-117715-1032-7s0i7n.1uv44y4x6r No license field.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Atom Beta\\Atom V1.20\\resources\\app\\apm\\bin\\node.exe" "C
:\\Atom Beta\\Atom V1.20\\resources\\app\\apm\\node_modules\\npm\\bin\\npm-cli.j
s" "--globalconfig" "C:\\Users\\Dan\\.atom\\.apm\\.apmrc" "--userconfig" "C:
\\Users\\Dan\\.atom\\.apmrc" "install" "C:\\Users\\Dan\\AppData\\Local\\
Temp\\d-117715-1032-q97u52.584e6lmcxr\\package.tgz" "--runtime=electron" "--targ
et=1.6.9" "--arch=x64" "--global-style" "--msvs_version=2015"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! node-pty@0.6.10 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-pty@0.6.10 install script 'node scripts/install.js'.

npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-pty package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-pty
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-pty
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Dan\AppData\Local\Temp\apm-install-dir-117715-1032-7s0
i7n.1uv44y4x6r\npm-debug.log
npm ERR! code 1