node.js - 无法安装 NodeJs 模块
问题描述
两天多来我一直在努力安装这个模块,但我做不到。你能告诉我我错过了哪一步吗?
https://github.com/swillner/netcdf4-js
这是我在nodejs上遇到的错误:
D:\master\nodeTut>npm install netcdf4
netcdf4@0.3.1 install D:\master\nodeTut\node_modules\netcdf4
node-gyp rebuild
D:\master\nodeTut\node_modules\netcdf4>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\master\nodeTut\node_modules\netcdf4
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'D:\master\nodeTut\package.json'
npm WARN nodeTut No description
npm WARN nodeTut No repository field.
npm WARN nodeTut No README data
npm WARN nodeTut No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! netcdf4@0.3.1 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the netcdf4@0.3.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ehsan\AppData\Roaming\npm-cache_logs\2018-06-11T22_02_31_364Z-debug.log
解决方案
尝试安装这个包,看看它是否能解决问题
npm install --global --production windows-build-tools
推荐阅读
- system-verilog - 使用队列或动态创建转换覆盖范围
- r - 找到带有通用字符 '[a,z]-\n' 的子字符串,并替换子字符串 '-\n' 的非通用部分
- c# - 您将如何在 RichTextBox 的代码中的特定文本的新行上添加新文本?
- api - Vue前端每次向Phalcon后端发送相同的请求,第二个失败,所以请求失败
- javascript - 需要一些帮助来解决这个循环
- javascript - 通过 redux/redux-thunk 发布到 mongoDB
- python - Python sort nested dictionaries by value descending
- java - Can't find any java examples of using the androidx navigation architecture for single activity using bottom navigation
- c - 如何避免系统设置的 EEPROM 结构中的全局变量?
- android - 使用 sharedPreference 通过两个活动传递数据