Skip to content

Postinstall script fails on Windows PowerShell, affects installs of non-CoffeeScript projects #4806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4O4 opened this issue Nov 30, 2017 · 4 comments

Comments

@4O4
Copy link

4O4 commented Nov 30, 2017

Hello, I don't use CoffeeScript at all but I ended up writing this issue after wasting some time on debugging why am I suddenly unable to do a successfull npm install on my TypeScript project. I work on win10 machine and use Windows Powershell as primary terminal for node and npm related stuff. Version info:

> node --version
v9.2.0          
> npm --version 
5.5.1           

Error details:

> [email protected] postinstall C:\my-project\node_modules\coffee-script
> node --eval 'if (require("./package.json").name === "coffee-script") { var red, yellow, cyan, reset; red = yellow = cyan = reset = ""; if (!process.env.NODE_DISABLE_COLORS) { red = "\x1b[31m"; yellow = "\x1b[33m"; cyan = "\x1b[36m"; reset = "\x1b[0m"; } console.warn(red + "CoffeeScript has moved!" + reset + " Please update references to " + yellow + "\"coffee-script\"" + reset + " to use " + yellow + "\"coffeescript\"" + reset + " (no hyphen) instead."); console.warn("Also, a new major version has been released under the " + yellow + "coffeescript" + reset + " name on NPM. This new release targets modern JavaScript, with minimal breaking changes. Learn more at " + cyan + "http://coffeescript.org" + reset + "."); console.warn(""); }'

[eval]:1
'if
^^^

SyntaxError: Invalid or unexpected token
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:573:30)
    at evalScript (bootstrap_node.js:452:27)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:598:3
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node --eval 'if (require("./package.json").name === "coffee-script") { var red, yellow, cyan, reset; red = yellow = cyan = reset = ""; if (!process.env.NODE_DISABLE_COLORS) { red = "\x1b[31m"; yellow = "\x1b[33m"; cyan = "\x1b[36m"; reset = "\x1b[0m"; } console.warn(red + "CoffeeScript has moved!" + reset + " Please update references to " + yellow + "\"coffee-script\"" + reset + " to use " + yellow + "\"coffeescript\"" + reset + " (no hyphen) instead."); console.warn("Also, a new major version has been released under the " + yellow + "coffeescript" + reset + " name on NPM. This new release targets modern JavaScript, with minimal breaking changes. Learn more at " + cyan + "http://coffeescript.org" + reset + "."); console.warn(""); }'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

This is caused by the recently merged PR #4759. The node --eval ... script / command is not compatible with powershell. It is a huge issue for me, becase as I said before - I'm not even a direct user of CoffeeScript. Some of my dependencies (or dependencies of dependencies) must be using it.

@4O4 4O4 changed the title Postinstall script fails on Windows PowerShell, affects installs non-CoffeeScript projects Postinstall script fails on Windows PowerShell, affects installs of non-CoffeeScript projects Nov 30, 2017
@Think4866
Copy link

Thanks for opening this issue - I just ran into this issue as well!

@Lars-Kristian
Copy link

I also got this issue.

@siiron
Copy link

siiron commented Nov 30, 2017

+1

I'm also on Windows 10, node v8.9.1 and npm 5.5.1, using cmdr for my main terminal, but the issue is also caused using native cmd on windows.

Not using coffee-script/ coffeescript directly but it is installed through sub-dependencies.
I get an identical error, and currently it's breaking everything. Major foobar :-(

honzajavorek added a commit to apiaryio/dredd that referenced this issue Nov 30, 2017
@vendethiel
Copy link
Collaborator

Duplicate of #4805

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants