-
Notifications
You must be signed in to change notification settings - Fork 297
apm installed under WSL doesn't work correctly: "/opt/atom/resources/app/apm/bin/node.exe: No such file or directory" #751
Comments
Any fix on this? I have the same issue today. |
I installed atom in my Windows Subsystem for Linux Ubuntu 18.04, which have the same error. To fix it, just remove the additions in this commit 10525a7 as @bonotake mentioned: $ cd /your/atom/installed/path
$ vi resources/app/apm/bin/apm # if you install atom using apt-get install atom, it will be at: /usr/share/atom/resources/app/apm/bin/apm My apm file changes (apm version: 1.19.0, atom version 1.27.2) : Before: # Detect node binary name
osName=`uname -s`
if [ "${osName:0:10}" == 'MINGW32_NT' ]; then
nodeBin="node.exe"
elif [[ $(uname -r) == *-Microsoft ]]; then
nodeBin="node.exe"
else
nodeBin="node"
fi
...
cliPath="$binDir/../lib/cli.js"
if [[ $(uname -r) == *-Microsoft ]]; then
cliPath="$(echo $cliPath | sed 's/\/mnt\/\([a-z]*\)\(.*\)/\1:\2/')"
cliPath="${cliPath////\\}"
else
builtin cd "$initialCwd"
fi After: # Detect node binary name
osName=`uname -s`
if [ "${osName:0:10}" == 'MINGW32_NT' ]; then
nodeBin="node.exe"
elif [[ $(uname -r) == *-Microsoft ]]; then
nodeBin="node" #change 1: remove ".exe"
else
nodeBin="node"
fi
...
cliPath="$binDir/../lib/cli.js"
# change 2: comment below lines
#if [[ $(uname -r) == *-Microsoft ]]; then
# cliPath="$(echo $cliPath | sed 's/\/mnt\/\([a-z]*\)\(.*\)/\1:\2/')"
# cliPath="${cliPath////\\}"
#else
builtin cd "$initialCwd"
#fi |
took me 2 hrs. to resolve this issue today - the fix worked for me under WSL w/ Ubuntu- Bionic Beaver- thx!!! $ apm --version well done, @genshen!! |
Thank You. For people who want to conquer WSL, give me a shout because I have a full working xfce4 GUI and lots of other cool things actually working in it now. |
I applied the changes to the file #!/bin/bash
set -e
initialCwd=`pwd -P`
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
apmPath=$0
builtin cd "`dirname "$apmPath"`"
binDir=`basename "$apmPath"`
# Detect node binary name
osName=`uname -s`
if [ "${osName:0:10}" == 'MINGW32_NT' ]; then
nodeBin="node.exe"
elif [[ $(uname -r) == *-Microsoft ]]; then
nodeBin="node" #change 1: remove ".exe"
else
nodeBin="node"
fi
cliPath="$binDir/../lib/cli.js"
# change 2: comment below lines
#if [[ $(uname -r) == *-Microsoft ]]; then
# cliPath="$(echo $cliPath | sed 's/\/mnt\/\([a-z]*\)\(.*\)/\1:\2/')"
# cliPath="${cliPath////\\}"
#else
builtin cd "$initialCwd"
#fi
# Force npm to use its builtin node-gyp
unset npm_config_node_gyp
export ATOM_APM_ORIGINAL_PYTHON="${PYTHON:-}"
# Assumption: env iterates through environment variables in the same order that
# process.env iterates through properties within npm. So, we take the last match.
for var in $(env | grep -i ^npm_config_python=)
do
ATOM_APM_ORIGINAL_PYTHON="${var#*=}"
unset ${var%%=*}
done
export npm_config_python="${binDir}/python-interceptor.sh"
cliPath="$binDir/../lib/cli.js"
if [[ $(uname -r) == *-Microsoft ]]; then
cliPath="$(echo $cliPath | sed 's/\/mnt\/\([a-z]*\)\(.*\)/\1:\2/')"
cliPath="${cliPath////\\}"
else
builtin cd "$initialCwd"
fi
"$binDir/$nodeBin" "$cliPath" "$@"
And I am getting the following error: neo@DESKTOP-R88JKVQ:/mnt/c/WINDOWS/system32$ apm --version
/usr/bin/apm: line 55: apm/node: No such file or directory |
thank.
|
Prerequisites
Description
I have installed Atom under Ubuntu on Windows Subsystem for Linux (i.e. I installed it on WSL, not on Windows). But the commands
apm
doesn't work correctly so far.The first error occurred was: "/usr/bin/apm: line 46: /opt/atom/resources/app/apm/bin/node.exe: No such file or directory". I checked the code and reverted this commit so the error dissappeared.
Steps to Reproduce
sudo apt install atom
.dpkg -i atom-amd64.deb
.apm --version
Expected behavior: The version of
apm
should be appeared.Actual behavior: The error below occurs:
Reproduces how often: 100%, every time.
Versions
apm --version
cannot be done, as I mentioned above.Additional Information
I guess this commit is for following the WSL/Windows interoperability and running Windows' native Atom from WSL, but is it strange to install and use Atom on WSL side?
The text was updated successfully, but these errors were encountered: