【问题标题】:Can't install jQuery File Upload in expressjs无法在 expressjs 中安装 jQuery File Upload
【发布时间】:2017-03-16 06:30:57
【问题描述】:

我是 nodejs 的新手。 当我要安装 blueimp-file-upload-expressjs 时出现以下错误。

D:\WorkShop\Express\zipzap>npm install blueimp-file-upload-expressjs --save
npm WARN deprecated lodash-node@2.4.1: This package is discontinued. Use lodash@^4.0.0.

> lwip@0.0.6 install D:\WorkShop\Express\zipzap\node_modules\lwip
> node-gyp rebuild


D:\WorkShop\Express\zipzap\node_modules\lwip>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" 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:454:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:480: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:114:15)
gyp ERR! System Windows_NT 10.0.14393
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:\WorkShop\Express\zipzap\node_modules\lwip
gyp ERR! node -v v7.7.2
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
zipzap@0.0.0 D:\WorkShop\Express\zipzap
+-- async@0.9.2  extraneous
+-- aws-sdk@2.28.0  extraneous
+-- formidable@1.1.1  extraneous
`-- mkdirp@0.5.0  extraneous

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "blueimp-file-upload-expressjs" "--save"
npm ERR! node v7.7.2
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE

npm ERR! lwip@0.0.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lwip@0.0.6 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the lwip package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs lwip
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls lwip
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\WorkShop\Express\zipzap\npm-debug.log

D:\WorkShop\Express\zipzap>

如何安装和使用这个插件?也无法理解实际错误是什么。 我正在研究nodejs。那它为什么要python路径??

【问题讨论】:

  • 我可以建议两个选项:首先将您的节点降级到 6 并再次测试,其次:可能升级 node-gyp@latest 并再次检查,请参阅github.com/EyalAr/lwip/issues/206

标签: jquery node.js express jquery-file-upload


【解决方案1】:

@Dipankar Naskar:那它为什么要输入 python 路径??

因为 Node.js 是使用 GYP 构建的——用 Python 编写的跨平台构建工具。还有一些其他的构建步骤是在 Python 中实现的。因此,从源代码构建节点需要 Python。

@Dipankar Naskar:如何安装和使用这个插件?

这是几乎情况下的解决方案。

Node.js 的配置步骤现在应该如下:

安装VC++ Build Tools Technical Preview,选择自定义安装,然后选择Windows 8.1 和Windows 10 SDK。

? [仅限 Windows 7] 需要 .NET Framework 4.5.1

安装 Python 2.7 或 3.6,并将其添加到您的 PATHnpm config set python python2.7

启动 cmd,npm config set msvs_version 2015 --global(这是每次都不是 npm install [package name] --msvs_version=2015。)

太多了 npm install?

注意:对于您的问题,您只需安装 Python,将其添加到您的 PATHnpm config set python python2.7

【讨论】:

    猜你喜欢
    • 2012-04-20
    • 2014-06-06
    • 2014-02-18
    • 2014-05-28
    • 2014-08-26
    • 1970-01-01
    • 2012-05-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多