当我运行sudo npm install -g量角器时,得到错误,看起来没有那个文件夹/文件。有谁知道如何解决这个问题?非常感谢:)
<a-assets>
<video muted id="penguin-sledding" autoplay loop="true" src="v.mp4">
</a-assets>
<a-video src="#penguin-sledding" width="16" height="9" position="0 0 -20"></a-video>
答案 0 :(得分:1)
这在节点6.9.2上是可重现的。我相信这个版本的节点在npm中是错误的。
❯ nvm install 6.9.2 ⏎
Downloading https://nodejs.org/dist/v6.9.2/node-v6.9.2-darwin-x64.tar.xz...
######################################################################## 100.0%
WARNING: checksums are currently disabled for node.js v4.0 and later
Now using node v6.9.2 (npm v3.10.9)
❯ npm i - g @types/node
npm ERR! addLocal Could not install /Users/cnishina/-
npm ERR! Darwin 16.3.0
npm ERR! argv "/Users/cnishina/.nvm/versions/node/v6.9.2/bin/node" "/Users/cnishina/.nvm/versions/node/v6.9.2/bin/npm" "i" "-" "g" "@types/node"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! path /Users/cnishina/-
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/cnishina/-'
npm ERR! enoent ENOENT: no such file or directory, open '/Users/cnishina/-'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/cnishina/npm-debug.log
安装6.9.3后,错误就消失了:
❯ nvm install 6.9.3
Downloading https://nodejs.org/dist/v6.9.3/node-v6.9.3-darwin-x64.tar.xz...
######################################################################## 100.0%
WARNING: checksums are currently disabled for node.js v4.0 and later
npm i -g @tNow using node v6.9.3 (npm v3.10.10)
❯ npm i -g @types/node
/Users/cnishina/.nvm/versions/node/v6.9.3/lib
└── @types/node@7.0.1
我还建议安装最新的节点6.在本文发布时,它是节点6.9.4。我已经检查过安装@types/node
也适用于节点6.9.4。
答案 1 :(得分:0)
有些同样问题的人发现将版本降低到4.0.4会有所帮助。但似乎经常出错。仍然不是一个很酷的解决方案,但似乎对某些人有用。