Ember Serve tries to run a .sh file on Windows
Ember Serve tries to run a .sh file on Windows
Steps to Reproduce
Create a new Ember Serve run configuration.
Expected behavior: The same behaviour as running ember serve from the CLI.
Actual behavior: The following error occurs:
C:/DEV/nvm/v10.16.0/node C:/DEV/Projects/ember-quickstart/node_modules/.bin/ember serve
C:\DEV\Projects\ember-quickstart\node_modules\.bin\ember:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at Module._compile (internal/modules/cjs/loader.js:721:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Process finished with exit code 1
Reproduces how often: 100%
Versions
WebStorm 2019.1.3 Build #WS-191.7479.14, built on May 27, 2019
v2019.1.2-0
Additional Information
See: https://stackoverflow.com/questions/56542056/emberjs-webstorm-and-windows-cannot-run-through-ember-serve-configuration
Same here! Latest PHPStorm and intellij-emberjs.
I just had this mysteriously start happening to a previously-working ember serve run configuration, which left me scratching my head furiously for a while. I ended up comparing the .idea/workspace.xml from the affected project with that from another project (which was still working perfectly!) and have concluded that it's the node interpreter setting which causes this issue.
It seems that in earlier versions, the node interpreter setting either didn't exist or defaulted to an empty value - but now it can't be left blank within the UI, so if you edit an existing run config or create a new one, it'll be set to the default (which, at least in my case, is called "Project" but lists the path to my system-level installation of node.exe). Once a node interpreter is selected, the run config will try to use it to run the unix version of the ember command instead of running the Windows version (ember.cmd) directly (as it does when no node interpreter is configured).
As a workaround, you can get your broken run configuration(s) working (again) by closing Webstorm, editing the .idea/workspace.xml file and then starting Webstorm again. Once you've closed Webstorm:
- open
.idea/workspace.xmlin a text editor of some kind - search for any
<configuration>blocks withtype="EMBER_SERVE_CONFIGURATION" - within each such
<configuration>block, remove any<node-interpreter>tags (such as<node-interpreter value="project" />) - save and close the file
- reopen Webstorm
Same here. The workaround described by @pauln works, but has to be re-applied every time if I modify run/debug configurations. My version is IntelliJ IDEA 2019.3 Ultimate Edition with Ember.js plugin 2019.3.1-0. My OS is windows 10 v1809 on arch amd64.
The workaround does not work anymore with v2019.3.3-0.
"C:/Program Files/nodejs/node" C:/Users/bla/sources/blub/web-ui/node_modules/.bin/ember serve C:\Users\bla\sources\blub\web-ui\node_modules.bin\ember:2 basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^
SyntaxError: missing ) after argument list at new Script (vm.js:80:7) at createScript (vm.js:274:10) at Object.runInThisContext (vm.js:326:10) at Module._compile (internal/modules/cjs/loader.js:664:28) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) at Function.Module.runMain (internal/modules/cjs/loader.js:754:12) at startup (internal/bootstrap/node.js:283:19)
Process finished with exit code 1
@iqdoq-dfischer I'm having the same issue as you. What I ended up doing was opening the package.json file and clicked the "Play" icon for the "ember serve" line. Not really a fix but at least that's what I'm doing until something gets resolved here.