Flow: Flow doesn't work with npm v5.4.0

Created on 29 Aug 2017  路  8Comments  路  Source: facebook/flow

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

There is no problem with npm 4.x and 5.3.0, only with npm 5.4.0.

Environment

node -v: v8.4.0
npm -v: v5.4.0
npm ls react-scripts: I tried with 1.0.10, 1.0.11 and 1.0.12
npm ls flow-bin: I tried with 0.52.0 and 0.53.1
Operating system: macOS Sierra v10.12.6

Steps to Reproduce

  1. In Terminal:
$ create-react-app test-flow
$ cd test-flow
$ npm install --save-dev flow-bin
  1. Add "flow": "flow" to the scripts section of your package.json.
  2. Run npm run flow init
  3. And you will see the error:
> [email protected] flow /Users/admin/Sites/test-flow
> flow "init"

internal/child_process.js:325
    throw errnoException(err, 'spawn');
    ^

Error: spawn EACCES
    at _errnoException (util.js:1041:11)
    at ChildProcess.spawn (internal/child_process.js:325:11)
    at exports.spawn (child_process.js:493:9)
    at Object.<anonymous> (/Users/admin/Sites/test-flow/node_modules/flow-bin/cli.js:17:3)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Function.Module.runMain (module.js:609:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] flow: `flow "init"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] flow script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Flow worked good a few days ago (with react-scripts 1.0.10), but now it doesn't work (even with react-scripts 1.0.10).

Most helpful comment

I ran into the same issue and overcame it by running chmod +x node_modules/flow-bin/flow-osx-v0.54.0/flow.

All 8 comments

I was running into this same error after upgrading to Flow 0.54 today, but I was seeing really inconsistent success even between various versions of npm and flow-bin. I believe this issue is probably caused by https://github.com/npm/npm/issues/18324

Ran into the same issue, yarn global add flow-bin worked well.

I ran into the same issue and overcame it by running chmod +x node_modules/flow-bin/flow-osx-v0.54.0/flow.

Thank you @sandersky your workaround/solution worked.

Thank you @sandersky it worked for me as well.

Thank you @sandersky for the suggestion.

Looking forward to the fix as I don't want to be running chmod +x .... everytime :wink:

PSA: npm 5.4.1 has been released and it fixes this issue for me. It's npm i npm@latest -g time.

had same problem on mac with npm 5.4.0. updated npm to 5.5.1 then uninstalled flow and reinstalled now all good.

Was this page helpful?
0 / 5 - 0 ratings