尝试安装loopback cli工具时出错

时间:2018-03-31 17:52:48

标签: node.js npm backend loopbackjs

我一直在尝试使用命令npm install -g loopback-cli在Windows上安装loopback nodejs框架。但是,我收到以下错误

> gyp ERR! configure error gyp ERR! stack Error: Can't find Python
> executable "python", you can set the PYTHON env variable. gyp ERR!
> stack     at PythonFinder.failNoPython
> (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\configure.js:483:19)
> gyp ERR! stack     at PythonFinder.<anonymous>
> (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\configure.js:508:16)
> gyp ERR! stack     at
> C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
> gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21) gyp ERR!
> System Windows_NT 10.0.16299 gyp ERR! command "C:\\Program
> Files\\nodejs\\node.exe"
> "C:\\Users\\HP\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\npm-lifecycle\\node_modules\\node-gyp\\bin\\node-gyp.js"
> "rebuild" gyp ERR! cwd
> C:\Users\HP\AppData\Roaming\npm\node_modules\loopback-cli\node_modules\ursa
> gyp ERR! node -v v8.11.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok
> npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ursa@0.9.4
> (node_modules\loopback-cli\node_modules\ursa): npm WARN optional
> SKIPPING OPTIONAL DEPENDENCY: ursa@0.9.4 install: `node-gyp rebuild`
> npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

1 个答案:

答案 0 :(得分:2)

您需要Python 2.7.x才能在您的计算机上运行。 您的Windows机器缺少必要的构建工具。

npm安装Windows构建工具。

Locale locale = new Locale("ru"); Locale.setDefault(locale); Configuration config = getBaseContext().getResources().getConfiguration(); config.locale = locale; getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());