Closed tillig closed 9 months ago
Actually it can be any NODE specific env variable. I have this warning, because NODE_OPTIONS=--enable-source-maps
Actually it can be any NODE specific env variable. I have this warning, because NODE_OPTIONS=--enable-source-maps
Same here. I had exported such NODE_OPTIONS in my bashrc
# ~/.bashrc
# nodejs memory limit
# https://www.npmjs.com/package/increase-memory-limit
export NODE_OPTIONS=--max_old_space_size=4096
For a moment I thought this was related to my recent update of node from 20.10.0 to 20.11.0 but then I'm quite sure it's only related to VSCode. In case it helps
Version: 1.86.0 (Universal)
Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937
Date: 2024-01-31T10:29:15.765Z (2 days ago)
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0
Same here — vscode just updated this morning, and now typing code [path]
at the command prompt generates this error every time.
vscode info:
Version: 1.86.0 (Universal)
Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937
Date: 2024-01-31T10:29:15.765Z (2 days ago)
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0
I updated vscode this morning and I'm experience the same issue, same behaviour every time I write code filename
at the cli prompt generates this error every time.
Version: 1.86.0 (Universal)
Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937
Date: 2024-01-31T10:29:15.765Z
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0
❓ Is there a work around for this?
Personally I've not experienced any issues so it's just a warning that for now it can be ignored or is this causing problems for you? I'm not using VSCode terminal but I wonder if it can affect node running there?
Hey 👋, any workaround for this? I am getting the same issue. Thank you.
My workaround is that in the code
wrapper shell script (located at /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
in macos, linux users can figure out where it is, ymmv on windows whether you're in WSL or not), just before
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
, i add
unset NODE_VERSION_PREFIX
unset NODE_VERSIONS
(those env vars are provided by nvm, i think)
So, just add that for whatever NODE_*
environment variables you have, such as
unset NODE_OPTIONS
unset NODE_EXTRA_CA_CERTS
I also started having this since VSCode 1.86.0.
I believe it's related to NVM.
I have NVM installed with HomeBrew, and in my .zshrc
file I have:
NVM_HOMEBREW="/opt/homebrew/opt/nvm/nvm.sh"
[ -s "$NVM_HOMEBREW" ] && \. "$NVM_HOMEBREW"
[ -x "$(command -v npm)" ] && export NODE_PATH=$NODE_PATH:`npm root -g`
I commented out the last line, so now it looks like:
NVM_HOMEBREW="/opt/homebrew/opt/nvm/nvm.sh"
[ -s "$NVM_HOMEBREW" ] && \. "$NVM_HOMEBREW"
# [ -x "$(command -v npm)" ] && export NODE_PATH=$NODE_PATH:`npm root -g`
For the time being this seems to work and I don't get anymore the warning when I run code [filename]
.
I don't have node installed on my system at all and yet I get this error too, so am guessing it's most likely an internal vscode bug in the latest update
The issue stems from Electron (VSCode's build engine), where this error message is part of the source code: https://github.com/electron/electron/blob/2ebaebb603620f18ba231bda684f9af392c76923/shell/app/node_main.cc#L144
I resolved this issue on my end by removing any Node env vars from my ~/.zshrc
file. In my case, all I had set was export NODE_NO_WARNINGS=1
, and removing that line fixed it.
Fwiw, I recently updated to Mac OS Sonoma 14.3. Prior to that, I never ran into this issue. It's possible Apple tightened up security measures and introduced something that causes this warning to appear. That's the only thing I've changed on my machine since this issue started happening.
Inserting the following lines in the code.sh
script above the invocation will unset all NODE_* vars:
for node_env_var in $(env | grep -E '^NODE_\w+' --only-matching); do
unset $node_env_var
done
This is MacOS only. But I suspect the check here may be too broad? https://github.com/electron/electron/blob/3ec04fd4492c889c070ed3d5c95b914a577c8864/shell/app/node_main.cc#L133C8-L133C55
When running code <whatever>
from Terminal I do expect shell variables to be used/available inside Code. I also don't expect Code to run sandboxed in this case if it was properly installed into /Applications
.
//cc @zcbenz
i also meet this issue
vscode version:
1.86.0
05047486b6df5eb8d44b2ecd70ea3bdf775fd937
arm64
macos:
14.2.1 (23C71)
This also happens to me on macOS 14.3 (23D56) and VSCode version 👇
1.86.0
05047486b6df5eb8d44b2ecd70ea3bdf775fd937
x64
+1 also happening here on macOS 14.2.1 (23C71)
Version: 1.86.0 (Universal)
Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937
Date: 2024-01-31T10:29:15.765Z (4 days ago)
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.2.0
❯ c
[0205/221330.306976:ERROR:node_main.cc(135)] Node.js environment variables are disabled because this process is invoked by other apps.
got the same here 😬
System:
OS: macOS 14.3
CPU: (10) arm64 Apple M1 Pro
Memory: 100.84 MB / 16.00 GB
Shell: 5.9 - /opt/homebrew/bin/zsh
Binaries:
Node: 21.1.0 - ~/Library/Caches/fnm_multishells/21097_1707170535908/bin/node
Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/21097_1707170535908/bin/yarn
npm: 10.4.0 - ~/Library/Caches/fnm_multishells/21097_1707170535908/bin/npm
pnpm: 7.22.0 - ~/Library/Caches/fnm_multishells/21097_1707170535908/bin/pnpm
IDEs:
VSCode: 1.86.0 - /usr/local/bin/code
Vim: 9.1 - /opt/homebrew/bin/vim
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Bash: 5.2.26 - /opt/homebrew/bin/bash
If you install Node via Nix it sets NODE_PATH, so no way to avoid this error in that case.
My workaround is that in the
code
wrapper shell script (located at/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
in macos, linux users can figure out where it is, ymmv on windows whether you're in WSL or not), just before
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
, i addunset NODE_VERSION_PREFIX unset NODE_VERSIONS
(those env vars are provided by nvm, i think)
So, just add that for whatever
NODE_*
environment variables you have, such asunset NODE_OPTIONS unset NODE_EXTRA_CA_CERTS
That's not a workaround if you need to set NODE_EXTRA_CA_CERTS
to a self-signed certificate for a corporate VPN.
This is a total show-stopper for people working behind a corporate VPN and need to set NODE_EXTRA_CA_CERTS
to the firewall/VPN isssuer certificate. I see that it's an Electron issue, not VSCode. But still, is there a way to downgrade VSCode to a version not using that broken version of Electon?
Downgrading to 1.85 is what I did to work around this issue for now.
I've also been seeing this issue. If it may help triangulate: I do not use nvm (although it sounds like that's already been ruled out as the culprit), and similar to @beorn's comment, I do have NODE_PATH
set – this is the sole Node-related env var in my shell.
same issue, I used to call code
from my terminal as it picked up my env i carefully setup in bash. Now it ignores it all and doesn't work with any of my env flavors. Working and setting terminal inside VSCode I have no wish. Downgraded to 1.85
@deepak1556 Just to check - it appears the PR only handles NODE_OPTIONS
and NODE_REPL_EXTERNAL_MODULE
. What about others like NODE_EXTRA_CA_CERTS
and NODE_VERSION_PREFIX
that have been listed in this issue? Is there something sort of automatic about NODE_OPTIONS
that just takes care of it?
@deepak1556 Just to check - it appears the PR only handles
NODE_OPTIONS
andNODE_REPL_EXTERNAL_MODULE
. What about others likeNODE_EXTRA_CA_CERTS
andNODE_VERSION_PREFIX
that have been listed in this issue? Is there something sort of automatic aboutNODE_OPTIONS
that just takes care of it?
imho, we should inherit all environment variables from shell. There are so many needed and picked by VS Code tools, plugins, etc.
Agreed, since the PR only fixes NODE_OPTIONS it won't really fix the issue for all the other env vars. This issue is not closed.
The warnings about other envs were removed in Electron by https://github.com/electron/electron/pull/41079, wait for an update of Electron in VS Code and they should be gone.
AH! That was the missing piece of information. Thanks @zcbenz !
The update which @zcbenz mentioned has landed via https://github.com/microsoft/vscode/pull/204580, please check out latest insiders and it should have all the necessary fixes.
@deepak1556 Any idea on long does it take to be available publically so I can do a "Check for Updates" and see it?
This bug has been fixed in the latest release of VS Code Insiders!
@tillig, you can help us out by commenting /verified
if things are now working as expected.
If things still don't seem right, please ensure you're on version 7c15c66607256592202cc051fb3e117baf54af63 of Insiders (today's or later - you can use Help: About
in the command palette to check), and leave a comment letting us know what isn't working as expected.
Happy Coding!
It seems to be fixed in version: 1.86.2
/verified
It does appear to be fixed in 1.86.2.
Version: 1.86.2
Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda
Date: 2024-02-13T19:42:12.210Z
Electron: 27.2.3
ElectronBuildId: 26908389
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0
fixed.
I still have same problem with latest update
❯ git push [0418/115928.400333:ERROR:node_main.cc(149)] Node.js environment variables are disabled because this process is invoked by other apps.
Version: 1.88.1 (Universal) Commit: e170252f762678dec6ca2cc69aba1570769a5d39 Date: 2024-04-10T17:42:52.765Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Darwin arm64 23.4.0
Type: Bug
If you have a
NODE_EXTRA_CA_CERTS
environment variable in place, then when launching VS Code from a command line, a warning message is displayed:[0201/100616.044843:ERROR:node_main.cc(135)] Node.js environment variables are disabled because this process is invoked by other apps.
The extra certificates are required for our environment to support proxy/VPN connectivity. Ideally these values would be used in VS Code; but, at the very least, the warning shouldn't show up on the console during launch.
VS Code version: Code 1.86.0 (05047486b6df5eb8d44b2ecd70ea3bdf775fd937, 2024-01-31T10:29:11.933Z) OS version: Darwin arm64 23.3.0 Modes:
System Info
|Item|Value| |---|---| |CPUs|Apple M1 Max (10 x 24)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|6, 4, 3| |Memory (System)|32.00GB (3.50GB free)| |Process Argv|--disable-extensions --crash-reporter-id 1021646e-a5d4-4a1c-bf5d-3f1296f9cf93| |Screen Reader|no| |VM|0%|
A/B Experiments
``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 0bi6i642:30951795 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 accentitlementst:30887150 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 dsvsc019b:30953937 3ef8e399:30949928 ```