简体   繁体   English

npm安装期间出现aframe错误

[英]aframe error during installation with npm

I'm trying to install aframe and aframe-inspector. 我正在尝试安装aframe和aframe-inspector。 I tried every way for local development because I need to to something that requires the editing of the inspector. 我尝试了各种方式进行本地开发,因为我需要进行一些需要检查员进行编辑的工作。 But every time I try to install it, it fails during npm install or npm start. 但是每次我尝试安装它时,它在npm install或npm start期间都会失败。 For example, when I try to install aframe, it gives me error in npm install. 例如,当我尝试安装Aframe时,它在npm install中给我错误。 For inspector during start. 对于检查员在启动过程中。 I didn't find help since I seem the only one that has this kind of errors. 我没有找到帮助,因为我似乎是唯一出现这种错误的人。 How can I solve? 我该如何解决? I just need to edit aframe-inspector and I don't know hot to do it without installing it and I don't know how to proceed even after but this seems the right way. 我只需要编辑aframe-inspector,不安装它就不热,而且即使之后我也不知道如何进行操作,但这似乎是正确的方法。 I tried in ubuntu and in windows 10. Thx for future answers! 我在ubuntu和Windows 10中尝试过。

EDIT 1: I removed the part about the windows error. 编辑1:我删除了有关Windows错误的部分。 I don't need to make it work on windows, I don't want you to focus on that. 我不需要使其在Windows上运行,我不希望您专注于此。 I've got the last version of node.js. 我有最新版本的node.js。 Here you can see what kind of error I have when I try to install it. 在这里,您可以看到尝试安装它时遇到的错误类型。 Errors photos on drive 错误的驱动器上的照片

Here you can ses the log that I had when trying to install aframe with npm: Errors log while installing aframe 在这里,您可以找到尝试使用npm 安装aframe时遇到的日志安装aframe时出现错误日志

EDIT 2: I tried the same things on 2 different PCs in ubuntu. 编辑2:我在ubuntu的2台不同的PC上尝试了相同的事情。 I also tried this aframe boilerplate . 我也尝试过这种 框架样板 It didn't work either. 它也不起作用。

EDIT 3: I solved half of the problem. 编辑3:我解决了一半的问题。 AFrame library now is working on local in my pc but the inspector isn't working. AFrame库现在可以在我的PC本地工作,但检查器无法工作。 I solved the problem by updating node.js. 我通过更新node.js解决了这个问题。 I thought that was the last version because when I did sudo apt-get install nodejs my shell answered me that I had last version of node.js but it wasn't true. 我以为那是最后一个版本,因为当我执行sudo apt-get install nodejs时,我的shell回答我有最新版本的node.js,但这不是事实。 Then I had a doubt about it and I found on internet that I had to install NVM and then I had to install node with it. 然后我对此有疑问,并且在互联网上发现必须安装NVM,然后必须使用它安装node。 So now I just need to make the inspector work. 所以现在我只需要使检查员工作即可。 I couldn't find a way for now (the error of the inspector is still the same). 我暂时找不到方法(检查器的错误仍然相同)。

EDIT 4: I also tried in windows and it didn't work. 编辑4:我也尝试在Windows中,它不起作用。 I got 3 errors in 3 different situations: 我在3种不同情况下遇到3个错误:
- trying git clone error with git clone ; - 用git clone尝试git clone 错误 ; Then, after npm install: - trying npm start without doing anything error on npm start 然后,在安装npm之后:-尝试启动npm,而在启动npm时不做任何错误
- trying after git init in the inspector after git init -在git init之后在检查器中尝试git init

I got an older aframe version (current is 0.8.0) installed on Windows. 我在Windows上安装了较旧的Aframe版本(当前为0.8.0)。 I could install it both on node 6.9.0 and node 8.10.0 (changing node version using nvm): 我可以将其安装在node 6.9.0node 8.10.0 (使用nvm更改节点版本):

nvm use 8.10.0
npm cache verify
npm install aframe@0.7.0

Still I can't install current aframe@0.8.0, though. 不过,我仍然无法安装当前的aframe@0.8.0。


I also did this change: 我也做了这个改变:

git config --system core.longpaths true

(Link to a similar issue) - while trying to get 0.8.0 installed. (链接到一个类似的问题) -尝试安装0.8.0时。


Another option can be do download thee distribution from here and place it in your solution 另一个选择是从此处下载发行版本并将其放入您的解决方案中

Hope this can be to some help. 希望这可以有所帮助。

If you got an error about missing git, then you need to install git. 如果您收到有关缺少git的错误,则需要安装git。

Check it out on the website . 网站查看 There are download links for windows, and terminal commands for ubuntu. 有Windows的下载链接和ubuntu的终端命令。

As far as i know git is necessary to fetch dependencies, so it should be a must have. 据我所知git是获取依赖项所必需的,因此它必须是必须的。

I solved the problem using windows but I think to understand what was the problem. 我使用Windows解决了问题,但我想了解问题所在。
First of all, I couldn't clone the project so I downloaded it directly from the site. 首先,我无法克隆该项目,因此我直接从该站点下载了该项目。 I think that in that way it couldn't work. 我认为那样就行不通。
I couldn't clone the project because I'm a beginner with the use of git I think. 我无法克隆该项目,因为我是使用git的初学者。 I think that there are some problems with public keys/SHA that I don't know how to solve. 我认为公钥/ SHA存在一些我不知道如何解决的问题。 For this reason, in Windows, I downloaded Github Desktop and I made it handle for me. 因此,在Windows中,我下载了Github Desktop,并为我处理了它。 In that way, it worked. 这样,它起作用了。 I don't have the direct solution for ubuntu but I think that this can help someone. 我没有ubuntu的直接解决方案,但我认为这可以帮助某人。

If you do not plan to modify your local copy of A-Frame then directly using the minified version with <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script> should be enough. 如果您不打算修改A-Frame的本地副本,则直接使用带有<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>的压缩版本<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>应该足够了。

You can also just remix the existing Glitch in order to have a setup going live without setting up your own server. 您也可以只混合现有的Glitch ,以使设置生效 ,而无需设置您自己的服务器。

On the other hand if you do want to modify A-Frame itself then yes you do need git to be installed and available in your path or using a GUI. 另一方面,如果您确实想修改A-Frame本身,则是的,您确实需要安装git并在路径中或使用GUI可用。 Overall the toolchain relying on git , npm , etc is only necessary if you modify A-Frame and (arguably) provide value mostly if you are building a large project relying on those tools already. 总体而言,仅当您修改A-Frame并且(可以说)主要在您已经在依赖这些工具构建大型项目的情况下提供价值时,才需要依赖gitnpm等工具链。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM