Pymakr in VSCode can't find NodeJS (but it is installed)



  • Installing Pymakr into VSCode on my Mac, it repeatedly reports:

    "NodeJS not detected on this machine, which is required for Pymakr to work."

    However, nodejs LTS was installed from https://nodejs.org/ using the Mac installer with defaults and is located in /usr/local/bin.

    VSCode has been installed for months (and used extensively for Python dev), and updated monthly with new releases. I can't find anywhere to set a PATH inside VSCode, but when I open a terminal inside VSCode, it shows /usr/local/bin in the PATH. MacOS has also been restarted, with no change in behaviour.

    Any ideas how to resolve this issue? Software and log details below.

    Thanks.

    Software versions:
    MacOS: 10.14.6
    VSCode: 1.44.2

    • Commit: ff915844119ce9485abfe8aa9076ec76b5300ddd
    • Date: 2020-04-16T17:07:18.473Z
    • Electron: 7.1.11
    • Chrome: 78.0.3904.130
    • Node.js: 12.8.1
    • V8: 7.8.279.23-electron.0
    • OS: Darwin x64 18.7.0

    Pymakr: 1.1.6
    NodeJS (installed outside VSCode): v12.16.3

    VSCode console says:

    console.ts:137 [Extension Host] Serialport included without issues
    console.ts:137 [Extension Host] [warning] SettingsWrapper | Error processing Config file:/Users/user/Library/Application Support/Code/User/pymakr.json
    console.ts:137 [Extension Host] [warning] SettingsWrapper | Error processing Config file:null/pymakr.conf
    console.ts:137 [Extension Host] [warning] SettingsWrapper | Error opening config file 
    console.ts:137 [Extension Host] [warning] SettingsWrapper | Error: ENOENT: no such file or directory, open '/Users/user/Library/Application Support/Code/User/pymakr.json'
    console.ts:137 [Extension Host] [warning] SettingsWrapper | Error opening config file 
    console.ts:137 [Extension Host] [warning] SettingsWrapper | Error: ENOENT: no such file or directory, open 'null/pymakr.conf'
    notificationsAlerts.ts:40 NodeJS not detected on this machine, which is required for Pymakr to work. See the Pymakr readme for dependancies.
    onDidChangeNotification @ notificationsAlerts.ts:40
    


  • I've determined so far (by a small hack to pycom.pymakr/pymakr.js after installation) that the PATH that VSCode receives does not include /usr/local/bin, where the "node" executable is installed. (VSCode is being launched from Finder.)

    So the problem reduces to how to get that PATH into VSCode, which appears remarkably difficult in more recent versions of MacOS, and none of the recipes I've found work reliably without manual intervention. Moving node into /usr/bin is not possible due to MacOS System Integrity Protection.

    I can at least use pymakr now, but the extension or the installation instructions need to be updated to provide a workaround for this issue.


Log in to reply
 

Pycom on Twitter