NodeJS - 使用 NPM 安装时出错 [英] NodeJS - Error installing with NPM

查看:27
本文介绍了NodeJS - 使用 NPM 安装时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft Windows [版本 6.3.9600](c) 2013 年微软公司.版权所有.C:Windowssystem32>npm install caress-servernpm http GET https://registry.npmjs.org/caress-servernpm http 304 https://registry.npmjs.org/caress-servernpm http GET https://registry.npmjs.org/jspack/0.0.1npm http GET https://registry.npmjs.org/buffertoolsnpm http 304 https://registry.npmjs.org/jspack/0.0.1npm http 304 https://registry.npmjs.org/buffertools>buffertools@2.0.1 安装 C:Windowssystem32
ode_modulescaress-server
ode_模块缓冲工具>节点gyp重建C:Windowssystem32
ode_modulescaress-server
ode_modulesuffertools>节点G:
odejs
ode_modules
pmin
ode-gyp-bin\....
ode_modules
ode-gypin
ode-gyp.js" 重建吉普错误!配置错误吉普错误!堆栈错误:找不到 Python 可执行文件python",您可以设置 PYTHON 环境变量.吉普错误!堆栈在 failNoPython (G:
odejs
ode_modules
pm
ode_modules
ode-gyplibconfigure.js:101:14)吉普错误!堆栈在 G:
odejs
ode_modules
pm
ode_modules
ode-gyplibconfigure.js:64:11吉普错误!堆栈在 Object.oncomplete (fs.js:107:15)吉普错误!系统 Windows_NT 6.2.9200吉普错误!命令节点"G:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "重建"吉普错误!cwd C:Windowssystem32
ode_modulescaress-server
ode_modulesuffert工具吉普错误!节点 -v v0.10.25吉普错误!节点-gyp -v v0.12.2吉普错误!不好npm 错误!buffertools@2.0.1 安装:`node-gyp 重建`npm 错误!退出状态 1npm 错误!npm 错误!在 buffertools@2.0.1 安装脚本中失败.npm 错误!这很可能是 buffertools 包的问题,npm 错误!不是 npm 本身.npm 错误!告诉作者这在您的系统上失败:npm 错误!节点gyp重建npm 错误!您可以通过以下方式获取他们的信息:npm 错误!npm 所有者 ls 缓冲区工具npm 错误!上面可能有额外的日志输出.npm 错误!系统 Windows_NT 6.2.9200npm 错误!命令 "G:\nodejs\\node.exe" "G:\nodejs\node_modules\npm\bin\npm-cli.js"安装"爱抚服务器"npm 错误!cwd C:Windowssystem32npm 错误!节点 -v v0.10.25npm 错误!npm -v 1.3.24npm 错误!代码生命周期npm 错误!npm 错误!可以在以下位置找到其他日志记录详细信息:npm 错误!C:Windowssystem32
pm-debug.lognpm 错误!不行 代码 0C:Windowssystem32>

我正在安装某个 NodeJS 脚本 - Caress.但我不是不能.我使用的是 Windows 8.1,谁能告诉我我面临的问题是什么,为什么这个安装不起作用.就我所能想到的,buffertools 依赖似乎存在问题.不知道如何解决这个问题?

如果我从 github 下载构建并将其放置在节点模块中,则似乎没有任何效果.当我尝试启动时,使用 npm start 或在实施期间.

G:
odejs
ode_modulescaress-server>npm installG:
odejs
ode_modulescaress-server>npm start>caress-server@0.1.1 start G:
odejs
ode_modulescaress-server>节点示例/server.js信息 - socket.io 已启动模块.js:340抛出错误;^错误:找不到模块./build/Release/buffertools.node"在 Function.Module._resolveFilename (module.js:338:15)在 Function.Module._load (module.js:280:25)在 Module.require (module.js:364:17)在要求 (module.js:380:17)在对象<匿名>(G:
odejs
ode_modulescaress-server
ode_modulesuffertoolsuffertools.js:16:19)在 Module._compile (module.js:456:26)在 Object.Module._extensions..js (module.js:474:10)在 Module.load (module.js:356:32)在 Function.Module._load (module.js:312:12)在 Module.require (module.js:364:17)npm 错误!caress-server@0.1.1 开始:`node examples/server.js`npm 错误!退出状态 8npm 错误!npm 错误!在 caress-server@0.1.1 启动脚本中失败.npm 错误!这很可能是 caress-server 包的问题,npm 错误!不是 npm 本身.npm 错误!告诉作者这在您的系统上失败:npm 错误!节点示例/server.jsnpm 错误!您可以通过以下方式获取他们的信息:npm 错误!npm 所有者 ls 爱抚服务器npm 错误!上面可能有额外的日志输出.npm 错误!系统 Windows_NT 6.2.9200npm 错误!命令 "G:\nodejs\\node.exe" "G:\nodejs\node_modules\npm\bin\npm-cli.js" "开始"npm 错误!cwd G:
odejs
ode_modulescaress-servernpm 错误!节点 -v v0.10.25npm 错误!npm -v 1.3.24npm 错误!代码生命周期npm 错误!npm 错误!可以在以下位置找到其他日志记录详细信息:npm 错误!G:
odejs
ode_modulescaress-server
pm-debug.lognpm 错误!不行 代码 0G:
odejs
ode_modulescaress-server>

解决方案

正如下面所评论的,你可能不需要在 windows 上安装 VS,看看这个

<块引用>

删除您的 $HOME/.node-gyp 目录并重试.

在此处查看完整文档:node-gyp

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:Windowssystem32>npm install caress-server
npm http GET https://registry.npmjs.org/caress-server
npm http 304 https://registry.npmjs.org/caress-server
npm http GET https://registry.npmjs.org/jspack/0.0.1
npm http GET https://registry.npmjs.org/buffertools
npm http 304 https://registry.npmjs.org/jspack/0.0.1
npm http 304 https://registry.npmjs.org/buffertools

> buffertools@2.0.1 install C:Windowssystem32
ode_modulescaress-server
ode_
modulesuffertools
> node-gyp rebuild


C:Windowssystem32
ode_modulescaress-server
ode_modulesuffertools>node "G:

odejs
ode_modules
pmin
ode-gyp-bin\....
ode_modules
ode-gypin
ode-
gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (G:
odejs
ode_modules
pm
ode_modules
ode
-gyplibconfigure.js:101:14)
gyp ERR! stack     at G:
odejs
ode_modules
pm
ode_modules
ode-gyplibconfi
gure.js:64:11
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "G:\nodejs\node_modules\npm\node_modules\node-gyp\
bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:Windowssystem32
ode_modulescaress-server
ode_modulesuffert
ools
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! buffertools@2.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the buffertools@2.0.1 install script.
npm ERR! This is most likely a problem with the buffertools 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 their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "G:\nodejs\\node.exe" "G:\nodejs\node_modules\npm\bin\n
pm-cli.js" "install" "caress-server"
npm ERR! cwd C:Windowssystem32
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:Windowssystem32
pm-debug.log
npm ERR! not ok code 0

C:Windowssystem32>

I am installing a certain NodeJS script - Caress. But i am not unable to. I am using Windows 8.1, can anyone tell me what is the problem i am facing, and why is this installation not working. There seems to be a problem with the buffertools dependency, thats far as i can think. Dont know how maybe fix this?

If i download the build from github and place it in node-modules, nothing seems to work. when i try to start, using npm start, or during implementation either.

G:
odejs
ode_modulescaress-server>npm install

G:
odejs
ode_modulescaress-server>npm start

> caress-server@0.1.1 start G:
odejs
ode_modulescaress-server
> node examples/server.js

   info  - socket.io started

module.js:340
    throw err;
          ^
Error: Cannot find module './build/Release/buffertools.node'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (G:
odejs
ode_modulescaress-server
ode_modulesuf
fertoolsuffertools.js:16:19)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

npm ERR! caress-server@0.1.1 start: `node examples/server.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the caress-server@0.1.1 start script.
npm ERR! This is most likely a problem with the caress-server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node examples/server.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls caress-server
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "G:\nodejs\\node.exe" "G:\nodejs\node_modules\npm\bin\n
pm-cli.js" "start"
npm ERR! cwd G:
odejs
ode_modulescaress-server
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     G:
odejs
ode_modulescaress-server
pm-debug.log
npm ERR! not ok code 0

G:
odejs
ode_modulescaress-server>

解决方案

As commented below you may not need to install VS on windows, check this out

https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245

UPDATED 02/2016

Some npm plugins need node-gyp to be installed.

However, node-gyp has it's own dependencies (from the github page):

UPDATED 09/2016

If you're using Windows you can now install all node-gyp dependencies with single command (NOTE: Run As Admin in Windows PowerShell):

 $ npm install --global --production windows-build-tools

and then install the package

 $ npm install --global node-gyp

UPDATED 06/2018

https://github.com/nodejs/node-gyp/issues/809#issuecomment-155019383

Delete your $HOME/.node-gyp directory and try again.

See full documentation here: node-gyp

这篇关于NodeJS - 使用 NPM 安装时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆