gpt4 book ai didi

node.js - 运行时不支持平台 `npm run flow`

转载 作者:搜寻专家 更新时间:2023-11-01 00:39:38 24 4
gpt4 key购买 nike

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

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

$ 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有关。

最佳答案

Flow 需要 64 位操作系统。您可能正在运行 32 位版本的 Ubuntu 吗?

https://github.com/facebook/flow/issues/270了解 Flow 当前需要 64 位的原因。

关于node.js - 运行时不支持平台 `npm run flow`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39321393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com