Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在ubuntu上安装节点gyp时出错 npmhttp200https://registry.npmjs.org/weak/-/weak-0.2.2.tgz npm http GEThttps://registry.npmjs.org/bindings npm http 304https://registry.npmjs.org/bindings > weak@0.2.2安装节点_模块/弱 >节点gyp重建 回溯(最近一次呼叫最后一次): 文件“/usr/lib/node_modules/npm/node_modules/node gyp/gyp/gyp_main.py”,第18行,在 sys.exit(gyp.script_main()) AttributeError:'module'对象没有属性'script\u main' 哎呀!配置错误 哎呀!堆栈错误:`gyp`失败,退出代码:1 哎呀!在ChildProcess.onCpExit(/usr/lib/node_modules/npm/node_modules/node gyp/lib/configure.js:337:16)处堆栈 哎呀!ChildProcess.EventEmitter.emit上的堆栈(events.js:98:17) 哎呀!在Process.ChildProcess.\u handle.onexit(child\u Process.js:789:12)处堆栈 哎呀!Linux系统3.11.0-15-generic 哎呀!命令“node”“/usr/lib/node_modules/npm/node_modules/node gyp/bin/node gyp.js”“重建” 哎呀!节点-v v0.10.15 哎呀!节点gyp-v v0.12.1 哎呀!不好 npm错误!weak@0.2.2安装:`node gyp rebuild` npm错误!退出状态1 npm错误! npm错误!失败weak@0.2.2安装脚本。 npm错误!这很可能是软包装的问题, npm错误!与npm本身无关。 npm错误!告诉作者此操作在您的系统上失败: npm错误!节点gyp重建 npm错误!您可以通过以下方式获取他们的信息: npm错误!npm所有者是弱者 npm错误!上面可能还有其他日志输出。 npm错误!Linux系统3.11.0-15-generic npm错误!命令“node”“/usr/bin/npm”“安装”weak@0.2.2" npm错误!节点-v v0.10.15 npm错误!npm-V1.3.23 npm错误!代码失效循环 npm错误!不正常代码0_Javascript_Node.js_Ubuntu_Npm - Fatal编程技术网

Javascript 在ubuntu上安装节点gyp时出错 npmhttp200https://registry.npmjs.org/weak/-/weak-0.2.2.tgz npm http GEThttps://registry.npmjs.org/bindings npm http 304https://registry.npmjs.org/bindings > weak@0.2.2安装节点_模块/弱 >节点gyp重建 回溯(最近一次呼叫最后一次): 文件“/usr/lib/node_modules/npm/node_modules/node gyp/gyp/gyp_main.py”,第18行,在 sys.exit(gyp.script_main()) AttributeError:'module'对象没有属性'script\u main' 哎呀!配置错误 哎呀!堆栈错误:`gyp`失败,退出代码:1 哎呀!在ChildProcess.onCpExit(/usr/lib/node_modules/npm/node_modules/node gyp/lib/configure.js:337:16)处堆栈 哎呀!ChildProcess.EventEmitter.emit上的堆栈(events.js:98:17) 哎呀!在Process.ChildProcess.\u handle.onexit(child\u Process.js:789:12)处堆栈 哎呀!Linux系统3.11.0-15-generic 哎呀!命令“node”“/usr/lib/node_modules/npm/node_modules/node gyp/bin/node gyp.js”“重建” 哎呀!节点-v v0.10.15 哎呀!节点gyp-v v0.12.1 哎呀!不好 npm错误!weak@0.2.2安装:`node gyp rebuild` npm错误!退出状态1 npm错误! npm错误!失败weak@0.2.2安装脚本。 npm错误!这很可能是软包装的问题, npm错误!与npm本身无关。 npm错误!告诉作者此操作在您的系统上失败: npm错误!节点gyp重建 npm错误!您可以通过以下方式获取他们的信息: npm错误!npm所有者是弱者 npm错误!上面可能还有其他日志输出。 npm错误!Linux系统3.11.0-15-generic npm错误!命令“node”“/usr/bin/npm”“安装”weak@0.2.2" npm错误!节点-v v0.10.15 npm错误!npm-V1.3.23 npm错误!代码失效循环 npm错误!不正常代码0

Javascript 在ubuntu上安装节点gyp时出错 npmhttp200https://registry.npmjs.org/weak/-/weak-0.2.2.tgz npm http GEThttps://registry.npmjs.org/bindings npm http 304https://registry.npmjs.org/bindings > weak@0.2.2安装节点_模块/弱 >节点gyp重建 回溯(最近一次呼叫最后一次): 文件“/usr/lib/node_modules/npm/node_modules/node gyp/gyp/gyp_main.py”,第18行,在 sys.exit(gyp.script_main()) AttributeError:'module'对象没有属性'script\u main' 哎呀!配置错误 哎呀!堆栈错误:`gyp`失败,退出代码:1 哎呀!在ChildProcess.onCpExit(/usr/lib/node_modules/npm/node_modules/node gyp/lib/configure.js:337:16)处堆栈 哎呀!ChildProcess.EventEmitter.emit上的堆栈(events.js:98:17) 哎呀!在Process.ChildProcess.\u handle.onexit(child\u Process.js:789:12)处堆栈 哎呀!Linux系统3.11.0-15-generic 哎呀!命令“node”“/usr/lib/node_modules/npm/node_modules/node gyp/bin/node gyp.js”“重建” 哎呀!节点-v v0.10.15 哎呀!节点gyp-v v0.12.1 哎呀!不好 npm错误!weak@0.2.2安装:`node gyp rebuild` npm错误!退出状态1 npm错误! npm错误!失败weak@0.2.2安装脚本。 npm错误!这很可能是软包装的问题, npm错误!与npm本身无关。 npm错误!告诉作者此操作在您的系统上失败: npm错误!节点gyp重建 npm错误!您可以通过以下方式获取他们的信息: npm错误!npm所有者是弱者 npm错误!上面可能还有其他日志输出。 npm错误!Linux系统3.11.0-15-generic npm错误!命令“node”“/usr/bin/npm”“安装”weak@0.2.2" npm错误!节点-v v0.10.15 npm错误!npm-V1.3.23 npm错误!代码失效循环 npm错误!不正常代码0,javascript,node.js,ubuntu,npm,Javascript,Node.js,Ubuntu,Npm,我对弱或节点gyp没有直接依赖关系,但我猜它是我的其他依赖关系(express、phantom、ejs、aws sdk、矩)所必需的。有没有人遇到过这样的问题并且能够解决呢?这就是有效的方法。在安装过程中,您需要Python2.6 npm http 200 https://registry.npmjs.org/weak/-/weak-0.2.2.tgz npm http GET https://registry.npmjs.org/bindings npm http 304 https://re

我对弱或节点gyp没有直接依赖关系,但我猜它是我的其他依赖关系(express、phantom、ejs、aws sdk、矩)所必需的。有没有人遇到过这样的问题并且能够解决呢?

这就是有效的方法。在安装过程中,您需要Python2.6

npm http 200 https://registry.npmjs.org/weak/-/weak-0.2.2.tgz
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings

> weak@0.2.2 install node_modules/weak
> node-gyp rebuild

Traceback (most recent call last):
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 18, in <module>
    sys.exit(gyp.script_main())
AttributeError: 'module' object has no attribute 'script_main'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.11.0-15-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok 
npm ERR! weak@0.2.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the weak@0.2.2 install script.
npm ERR! This is most likely a problem with the weak 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 weak
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.0-15-generic
npm ERR! command "node" "/usr/bin/npm" "install" "weak@0.2.2"
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.23
npm ERR! code ELIFECYCLE

npm ERR! not ok code 0

如果您的python版本不是错误源,请检查是否安装了“gyp”。这与节点gyp中的gyp版本冲突

apt-get-remove-gyp


这个命令
sudo apt get install build essential
对我的情况很有帮助。

在Ubuntu 10.04上,安装libicu解决了我的问题


sudo-apt-get-install-libicu-dev

在Fedora 20上,重新安装gyp为我修复了这个问题

#!/bin/bash
#On Ubuntu Saucy:
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.6
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10

#you can switch between 2.6 & 2.7 using:
sudo update-alternatives --config python

#Btw I installed node using ppa:chris-lea/node.js

FWIW,我在Ubuntu 14.04(DigitalOcean)上安装量角器时遇到了类似的问题。重新安装节点gyp固定了it:

sudo yum reinstall gyp

我在试图安装wikimedia扩展mathoid时,在Ubuntu 16.04上遇到了这个问题

我尝试了所有建议,但没有成功,直到我:

apt-get install node-gyp

我已经安装了
build-essential
。我只需要跑:

sudo apt-get install librsvg2-2 librsvg2-dev

以下是在Ubuntu系统上成功安装node gyp的步骤:

1.首先,使用以下命令在Ubuntu中安装“make”构建工具:

sudo apt install python
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y;
二,。然后您需要安装一个合适的C/C++编译器工具链。我们将使用以下命令在此处安装GCC:

sudo apt install python
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y;
三,。安装python 2.7版本。(注意:节点gyp不支持Python 3)

四,。最后安装节点gyp npm包:

sudo apt update
sudo apt upgrade
sudo apt install python2.7 python-pip
附加但不重要:如果节点gyp存在任何与atom键盘布局相关的问题,请再安装以下一个软件包:

npm install -g node-gyp

就这些!现在应该可以正常工作了。

在Ubuntu18上,我必须安装必要的构建库才能让它正常工作

sudo apt-get install libxkbfile-dev

在我的例子中,它在LinuxMint19.2上失败了,因为某些原因,在运行时gcc++无法访问。 因此,通过安装build essentials,错误得以解决。 附言:

build essential软件包是编译Debian软件包所需的所有软件包的参考。它通常包括GCC/g++编译器和库以及一些其他实用程序。如果错误是由于“致命错误:dns_sd.h:没有此类文件或目录”,则可在上找到有关生成基本程序包列表的信息 32 |#包括“, 通过以下方式解决它

“sudo-apt-get-install-libavahi-compat-libdnssd-dev”,否则如果是由于python2引起的,请遵循 @Manish-Jangir法


sudo更新备选方案的具体内容是什么——配置python?它从2.6=>2.7=>2.6=>2.7?如何知道我们目前使用的是哪种python?您可以使用
which$(readlink-f`whichpython`)来评估每个命令行工具的版本
您可以通过命令
python找出使用的python版本--version
应该是一个公认的答案。降级到2.6并使用PPA是最后的选择。我在运行
npm install
时遇到了这个错误。
gip
包是
npm
的依赖项,因此删除它并不能解决我的问题,因为它也会删除
npm
。。。我在Ubuntu 14.04上。对于那些有类似问题的人,这为我在Ubuntu上解决了以下错误。“错误:没有这样的选项:--no parallel”在Ubuntu18.04中没有build essentials,但在早期版本的Ubuntu20中没有这个问题,感谢您对新安装的Ubuntu20的支持,在安装
build essentials
之前,我必须运行
sudo apt update