intellij-emberjs icon indicating copy to clipboard operation
intellij-emberjs copied to clipboard

Ember Serve tries to run a .sh file on Windows

Open RonyOCuinn opened this issue 6 years ago • 5 comments

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

RonyOCuinn avatar Jun 13 '19 08:06 RonyOCuinn

Same here! Latest PHPStorm and intellij-emberjs.

erveloso avatar Aug 15 '19 13:08 erveloso

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.xml in a text editor of some kind
  • search for any <configuration> blocks with type="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

pauln avatar Aug 28 '19 05:08 pauln

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.

iqdoq-dfischer avatar Dec 16 '19 10:12 iqdoq-dfischer

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 avatar Jan 10 '20 14:01 iqdoq-dfischer

@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.

Close0 avatar Feb 02 '20 09:02 Close0