You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Fix your path by adding export PATH=$PATH:"C:\Program Files\nodejs" to .bashrc)
Install ember-cli npm install -g ember-cli
(Fix your path by adding export PATH=$PATH:"C:\Users\USUARIOPC\AppData\Roaming\npm" to your .bashrc)
Run ember -v
Expected behaviour: Prints the ember-cli version
Actual behaviour:
$ ember -v
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module 'C:\Program Files\Git\Users\USUARIOPC\AppData\Roaming\npm\node_modules\ember-cli\bin\ember'
?[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)?[39m
?[90m at Function.Module._load (internal/modules/cjs/loader.js:862:27)?[39m
?[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)?[39m
?[90m at internal/main/run_main_module.js:18:47?[39m {
code: ?[32m'MODULE_NOT_FOUND'?[39m,
requireStack: []
}
The problem is that the emberstartup script is trying to load ember-cli from the wrong path. There is nothing under 'C:\Program Files\Git\Users\USUARIOPC\AppData\Roaming\npm\node_modules\ember-cli\bin\ember. That path does not even exist. In the startup script, located at C:\Users\USUARIOPC\AppData\Roaming\npm\ember, we have the following code:
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/node_modules/ember-cli/bin/ember" "$@"
ret=$?
else
node "$basedir/node_modules/ember-cli/bin/ember" "$@"
ret=$?
fi
exit $ret
And cygpath is giving the wrong the path. After some logging, I figured out the problem is:
Is this a problem we have to fix at ember-cli, or is it a problem with my system? My first temptation is to edit the C:\Users\USUARIOPC\AppData\Roaming\npm\ember to fix the path loading, in which case I may as well submit a PR, but I am not sure whether that is the rigth approach. It may be that I am doing something very wrong, since I do not usually use windows for coding tasks.
Thanks for any help!
If I hard-code the path by writing
case `uname` in
# *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
*CYGWIN*|*MINGW*|*MSYS*) basedir="C:\Users\USUARIOPC\AppData\Roaming\npm";;
esac
Then I get this output, which looks fine:
$ ember -v
ember-cli: 3.17.0
node: 12.16.2
os: win32 x64
The text was updated successfully, but these errors were encountered:
Is this a problem we have to fix at ember-cli, or is it a problem with my system?
FWIW, the script you are showing is not created by ember-cli at all, it is created by npm your package manager when you do a global install (e.g. npm install -g ember-cli).
Steps to reproduce:
export PATH=$PATH:"C:\Program Files\nodejs"
to.bashrc
)npm install -g ember-cli
export PATH=$PATH:"C:\Users\USUARIOPC\AppData\Roaming\npm"
to your.bashrc
)ember -v
Expected behaviour: Prints the
ember-cli
versionActual behaviour:
The problem is that the emberstartup script is trying to load ember-cli from the wrong path. There is nothing under
'C:\Program Files\Git\Users\USUARIOPC\AppData\Roaming\npm\node_modules\ember-cli\bin\ember
. That path does not even exist. In the startup script, located atC:\Users\USUARIOPC\AppData\Roaming\npm\ember
, we have the following code:And
cygpath
is giving the wrong the path. After some logging, I figured out the problem is:Is this a problem we have to fix at
ember-cli
, or is it a problem with my system? My first temptation is to edit theC:\Users\USUARIOPC\AppData\Roaming\npm\ember
to fix the path loading, in which case I may as well submit a PR, but I am not sure whether that is the rigth approach. It may be that I am doing something very wrong, since I do not usually use windows for coding tasks.Thanks for any help!
If I hard-code the path by writing
Then I get this output, which looks fine:
The text was updated successfully, but these errors were encountered: