安装MEAN Stack:npm -v module.js:338 throw err;错误:找不到模块"./cache/caching-client.js" [英] Installing MEAN Stack: npm -v module.js: 338 throw err; Error: Cannot find module './cache/caching-client.js'
问题描述
我认为我之前已经安装了node.js,但从未使用过自制软件.今天,我尝试对应用程序进行演练,但一开始就陷入了困境.我对编程还很陌生,所以我对为什么不能使它正常工作感到非常困惑.
I think I have installed node.js before but never used homebrew to do it. Today I tried to do a walkthrough of an application but got stuck at the very beginning. I am fairly new to programming so I am utterly confused as to why I can't get this to work.
我尝试了很多事情,但似乎找不到答案.
I have tried a lot of things but can't seem to find the answer.
这些是我为了安装MEAN堆栈而运行的命令:
These are the commands I run in order to install the MEAN stack:
-
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
(成功,没有错误) -
brew install node
(成功无误) - 我通过键入以下命令检查节点是否已正确安装:
node -v
v0.12.4
- 然后通过键入以下命令检查npm是否已正确安装:
npm -v
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
(succesful no errors)brew install node
(succesfull no errors)- I check if node has installed properly by typing:
node -v
v0.12.4
- I then check if npm is installed properly by typing:
npm -v
这是错误消息:
module.js:338
throw err;
^
Error: Cannot find module './cache/caching-client.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /usr/local/lib/node_modules/npm/lib/npm.js:22:24
at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/npm.js:466:3)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
除了使用Homebrew以外,我还以其他方式安装了节点,也许这使事情变得混乱了.请让我知道你的想法.
I have installed node in a different way other than using Homebrew and maybe that is messing things up. Please let me know your thoughts.
到目前为止,我一直试图做的是卸载节点并使用以下过程重新安装它: https://gist.github.com/DanHerbert/9520689
What I have tried to do so far is uninstall node and reinstall it using this process: https://gist.github.com/DanHerbert/9520689
推荐答案
也许您已经解决了,但是答案可能对其他人有用.
Maybe you've already fixed, but the answer might serve others.
我尝试了Mario在他的评论中链接到的帖子中的内容,但是没有用.碰巧我的npm安装在/Users/USERNAME/.node/bin/,所以我在.bash_profile文件中添加了以下行:export PATH ="$ HOME/.node/bin:$ PATH".
I tried what is in the post that Mario linked to in his comment, but it didn't work. It just so happens that my npm is installed at /Users/USERNAME/.node/bin/, so I added the following line in my .bash_profile file: export PATH="$HOME/.node/bin:$PATH".
这篇关于安装MEAN Stack:npm -v module.js:338 throw err;错误:找不到模块"./cache/caching-client.js"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!