为什么npm不能在lubuntu中安装干净的节点?

时间:2021-07-19 20:41:16

I am not good with linux. I installed node in /node. node subsequently installed itself in a directory called node. So the node files are in /node/node. I gave /node all permissions:

我不擅长linux。我在/node中安装了node。node随后将自己安装到一个名为node的目录中。节点文件位于/节点/节点。我给/node所有权限:

sudo chmod 0777 -R /node

Node is up and running. I can write a node script no problem. When I try to install a module using NPM it fails.

节点启动并运行。我可以编写一个节点脚本。当我尝试使用NPM安装模块时,它失败了。

sudo npm install --nodedir=/node/node jsdom
sudo npm install --nodedir=/node/node socket.io

eventually I just went crazy

最终我疯了

sudo npm -g -f install --nodedir=/node/node jsdom
sudo npm -g -f install --nodedir=/node/node socket.io

With force it won't explicitly state that it has errored but then when I try and run an actual script using the module it fails stating there is no implementation.

使用force时,它不会显式地声明它出错了,但是当我尝试使用模块运行实际脚本时,它失败了,说明没有实现。

Here is the terminal window.

这是终端窗口。

More Details

更多的细节

I did a clean install of lubuntu on Virtual Box on another machine and then repeated the entire install process from scratch. That is:

我在另一台机器上的虚拟机箱上安装了lubuntu,然后从头开始重复整个安装过程。那就是:

  1. install lubuntu and virtual box guest additions
  2. 安装lubuntuandvirtual box客户添加
  3. sudo apt-get install eclipse-cdt
  4. sudo apt-get安装eclipse cdt
  5. sudo apt-get install g++ curl libssl-dev apache2-utils
  6. sudo apt-get install g+ curl libssl-dev apache2-utils
  7. sudo apt-get install git-core
  8. sudo apt-get安装git-core
  9. cd .. to / (i believe this is called the root directory)
  10. cd . .to /(我想这叫做根目录)
  11. git clone git://github.com/ry/node.git (this creates /node with files inside)
  12. git克隆://github.com/ry/node.git(这会创建/节点,其中包含文件)
  13. cd node
  14. cd节点
  15. ./configure
  16. . / configure
  17. make
  18. 使
  19. sudo make install
  20. sudo make install
  21. sudo npm install jsdom
  22. sudo npm安装jsdom

and it is still giving the same error. I used these instructions for installing node on linux (although the instructions were written in 2010). Anyway, that is about as clean of an install as you can get but it is still failing.

它仍然给出相同的误差。我使用这些指令在linux上安装node(尽管这些指令是在2010年编写的)。无论如何,这是你能得到的最干净的安装,但它仍然是失败的。

1 个解决方案

#1


4  

This is a harmless warning. It tells that this particular package (policyfile) had no (git) repository specified in its package.json file at the time when version 0.0.4 was published.

这是一个无害的警告。它告诉我们这个特定的包(policyfile)在其包中没有指定(git)存储库。版本0.0.4发布时的json文件。

The warning is really added as a means to stimulate module authors to add a repository field to their packages at time of publishing. The warnings at time of publishing are merely a by-product.

警告实际上是作为一种手段添加的,以鼓励模块作者在发布时向他们的包添加存储库字段。发布时的警告只是一种副产品。

Another warning you may come across often is "No README data". For this, the same applies.

您可能经常遇到的另一个警告是“没有自述数据”。对于这一点,同样适用。

I do think it would be better if these kind of warnings would be silenced when installing, as they virtually indicate problems in behavior of a package when installed. That is, I have yet to come across a package that did behave wrongly because of it, and I do not see much chance for this to be the case.

我认为,如果这些警告在安装时被屏蔽,那就更好了,因为它们实际上表明了安装时包的行为存在问题。也就是说,我还没有遇到一个因为它而做出错误行为的包,而且我也没有看到有多少机会出现这种情况。

I am the current maintainer of the module which originates the warning message (normalize-package-data, but I do not control what is done with these warnings afterwards (i.e. whether they are shown to the user or ignored). I'll raise an issue about this on the npm project.

我是生成警告消息(normalize-package-data)的模块的当前维护人员,但我不控制之后对这些警告做什么(例如,它们是显示给用户还是被忽略)。我会在npm项目中提出这个问题。

#1


4  

This is a harmless warning. It tells that this particular package (policyfile) had no (git) repository specified in its package.json file at the time when version 0.0.4 was published.

这是一个无害的警告。它告诉我们这个特定的包(policyfile)在其包中没有指定(git)存储库。版本0.0.4发布时的json文件。

The warning is really added as a means to stimulate module authors to add a repository field to their packages at time of publishing. The warnings at time of publishing are merely a by-product.

警告实际上是作为一种手段添加的,以鼓励模块作者在发布时向他们的包添加存储库字段。发布时的警告只是一种副产品。

Another warning you may come across often is "No README data". For this, the same applies.

您可能经常遇到的另一个警告是“没有自述数据”。对于这一点,同样适用。

I do think it would be better if these kind of warnings would be silenced when installing, as they virtually indicate problems in behavior of a package when installed. That is, I have yet to come across a package that did behave wrongly because of it, and I do not see much chance for this to be the case.

我认为,如果这些警告在安装时被屏蔽,那就更好了,因为它们实际上表明了安装时包的行为存在问题。也就是说,我还没有遇到一个因为它而做出错误行为的包,而且我也没有看到有多少机会出现这种情况。

I am the current maintainer of the module which originates the warning message (normalize-package-data, but I do not control what is done with these warnings afterwards (i.e. whether they are shown to the user or ignored). I'll raise an issue about this on the npm project.

我是生成警告消息(normalize-package-data)的模块的当前维护人员,但我不控制之后对这些警告做什么(例如,它们是显示给用户还是被忽略)。我会在npm项目中提出这个问题。