简体   繁体   English

在这个项目中找不到 expo - 你运行 yarn / npm 安装了吗? Npm已经安装,expo目录存在

[英]Unable to find expo in this project - have you run yarn / npm install yet? Npm has been installed, expo directory exists

My Expo project is pretty much 9999999% errors thus far, and it finally reached its climax when it decided to throw an error I've never heard of at me:到目前为止,我的 Expo 项目几乎有 9999999% 的错误,当它决定向我抛出一个我从未听说过的错误时,它终于达到了高潮:

module not found: can't resolve '../utilities/platform'

I've never seen this, and I was explicitly working in an isolated styling file when it occurred.我从未见过这种情况,当它发生时,我明确地在一个孤立的样式文件中工作。 I deleted the file and the error persisted.我删除了文件,错误仍然存在。 Seeing that it was in node_modules, I figured that deleting node_modules would be helpful.看到它在 node_modules 中,我认为删除 node_modules 会有所帮助。 It wasn't.不是。 I deleted the node_modules and tried to run npm i --save afterwards but it kept erroring out.我删除了 node_modules 并尝试运行npm i --save ,但它一直出错。 I restarted my computer, deleted the new node_modules, and tried to run npm i --save yet again.我重新启动计算机,删除了新的 node_modules,并尝试再次运行npm i --save This time I was greeted with this:这次我收到了这样的问候:

read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json 
was generated for lockfileVersion@2. I'll try to do my best with it!
npm ERR! Maximum call stack size exceeded

Now, I have a half(ish) completed node_modules, and whenever I try to run expo start , which I have about 700000000 times before this, it tells me this...现在,我有一半(ish)完成的node_modules,每当我尝试运行expo start ,在此之前我有大约 700000000 次,它告诉我这个......

Unable to find expo in this project - have you run yarn / npm install yet?

Which, yes stupid I have my expo set up, and yes AGAIN, I just ran npm install about twenty-two times.哪个,是的,愚蠢的我已经设置了 expo,是的,我刚刚运行了 npm 安装了大约 22 次。 So I have absolutely no idea what happened, why it happened, or how to fix whatever happened.所以我完全不知道发生了什么,为什么会发生,或者如何解决发生的事情。 If you can help me I will award you my first born but fair warning that might take another 20 years如果你能帮助我,我会奖励你我的第一个出生但公平的警告,这可能需要 20 年

Try to remove all react-native data folders from "%appdata%\Temp" and execute following commands:尝试从 "%appdata%\Temp" 中删除所有 react-native 数据文件夹并执行以下命令:

cd android (if any) cd android(如果有)

gradlew clean

cd.. and remove the node_modules folder cd .. 并删除 node_modules 文件夹

npm cache clean --force

npm install

npm start -- --reset-cache

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

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