运行`npm run flow`时不支持平台

时间:2016-09-04 20:50:58

标签: node.js flowtype

我在Ubuntu 14.04上。节点版本为4.5.0npm版本为2.15.9

我的flow-bin开发依赖项中有0.32.0个版本package.json

$ cat package.json | grep flow-bin
"flow-bin": "^0.32.0",

flow-bin包在本地可用:

$ npm ls --depth 0 | grep flow
serverside-node-babel-mocha-flow@1.0.0 /home/mperdikeas/test-project
├── babel-plugin-transform-flow-strip-types@6.14.0
├── flow-bin@0.32.0

我的npm run flow目标是:

cat package.json |  grep \"flow\"
"flow": "flow; test $? -eq 0 -o $? -eq 2",

当我运行npm run flow时,我得到以下跟踪:

$ npm run flow

> serverside-node-babel-mocha-flow@1.0.0 flow /home/mperdikeas/test-project
> flow; test $? -eq 0 -o $? -eq 2

/home/mperdikeas/test-project/node_modules/flow-bin/cli.js:20
  throw new Error('Platform not supported.');
    ^

Error: Platform not supported.
    at Object.<anonymous> (/home/mperdikeas/test-project/node_modules/flow-bin/cli.js:20:9)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:974:3

npm ERR! Linux 3.13.0-62-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "flow"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! serverside-node-babel-mocha-flow@1.0.0 flow: `flow; test $? -eq 0 -o $? -eq 2`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serverside-node-babel-mocha-flow@1.0.0 flow script 'flow; test $? -eq 0 -o $? -eq 2'.
npm ERR! This is most likely a problem with the serverside-node-babel-mocha-flow package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     flow; test $? -eq 0 -o $? -eq 2
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs serverside-node-babel-mocha-flow
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls serverside-node-babel-mocha-flow
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/mperdikeas/test-project/npm-debug.log

当我直接从shell运行流程时(不使用npmpackage.json),我得到了相同的跟踪:

$ ./node_modules/flow-bin/vendor/flow
/home/mperdikeas/test-project/node_modules/flow-bin/cli.js:20
  throw new Error('Platform not supported.');
    ^

Error: Platform not supported.
at Object.<anonymous> (/home/mperdikeas/test-project/node_modules/flow-bin/cli.js:20:9)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/mperdikeas/test-project/node_modules/flow-bin/vendor/flow:16:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)

此消息的含义是什么,即不支持哪个平台?我该如何解决这个问题?

我的其他目标(例如npm run testnpm run start)运行正常。这似乎与Flow有关。

1 个答案:

答案 0 :(得分:3)

Flow需要64位操作系统。您是否有可能运行32位版本的Ubuntu?

https://github.com/facebook/flow/issues/270有一些关于Flow当前需要64位的背景。