简体   繁体   English

放大配置错误:找不到模块

[英]amplify configure Error: can't find module

Following https://docs.amplify.aws/start/getting-started/installation/q/integration/react-native/#option-2-follow-the-instructions按照https://docs.amplify.aws/start/getting-started/installation/q/integration/react-native/#option-2-follow-the-instructions

I did: npm install -g @aws-amplify/cli我做了:npm install -g @aws-amplify/cli

Then followed with:然后是:

amplify configure放大配置

I have Node.js, git, and npm all installed with versions that should be compatible.我有 Node.js、git 和 npm 都安装了应该兼容的版本。

After doing amplify configure:做放大配置后:

I receive the following error:我收到以下错误:

internal/modules/cjs/loader.js:883 throw err;内部/模块/cjs/loader.js:883 抛出错误; ^ ^

Error: Cannot find module 'C:\Users\Dev\AppData\Roaming\npm\node_modules\ @aws-amplify\cli\lib\run.js' ←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m ←[90m at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m ←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m ←[90m at internal/main/run_main_module.js:17:47←[39m { code: ←[32m'MODULE_NOT_FOUND'←[39m, requireStack: [] }错误:找不到模块 'C:\Users\Dev\AppData\Roaming\npm\node_modules\ @aws-amplify\cli\lib\run.js' ←[90m at Function.Module._resolveFilename (internal/modules/cjs/ loader.js:880:15)←[39m ←[90m 在 Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m ←[90m 在 Z86408593C34AF77FDD90DF932F8B5261]Z。 internal/modules/run_main.js:72:12)←[39m ←[90m at internal/main/run_main_module.js:17:47←[39m { 代码:←[32m'MODULE_NOT_FOUND'←[39m,requireStack:[] }

I'm on Windows 10我在 Windows 10

Any help would be appreciated thanks任何帮助将不胜感激谢谢

Edit: Also just another note.编辑:也只是另一个注释。 When I try to reinstall the -g @aws-amplify/cli it says it is already installed: Here are the first two lines:当我尝试重新安装 -g @aws-amplify/cli 时,它说它已经安装:这是前两行:

npm ERR! npm 错误! code EEXIST代码 EEXIST

npm ERR: path C.\Users\Dev\AppData\Roaming\npm\node_modules\ @aws-amplify\cli\lib\run.js npm ERR:路径 C.\Users\Dev\AppData\Roaming\npm\node_modules\ @aws-amplify\cli\lib\run.js

So, the paths appear to be the same.因此,路径似乎是相同的。

Edit:编辑:

Although when I do cd @aws-amplify it returns: The system cannot find the path specified.虽然当我执行 cd @aws-amplify 它返回:系统找不到指定的路径。

this is after I am already successfully in the node_modules folder这是在我已经成功进入 node_modules 文件夹之后

And navigating into the npm folder there are three things labeled amplify.并导航到 npm 文件夹中,标记为放大的三件事。 A file, Windows Command Script, and Windows PowerShell.一个文件,Windows 命令脚本和 Windows PowerShell。 So has the installation process changed.安装过程也发生了变化。 Now that I've located these files how is AWS Amplify CLI supposed to work so I can set up with amplify configure现在我已经找到了这些文件,AWS Amplify CLI 应该如何工作,所以我可以使用 amplify configure 进行设置

Solution:解决方案:

I put this in one of the comments below but figured people may want to try this in the future if they come across the same error.我把它放在下面的评论之一中,但我想如果人们遇到同样的错误,他们可能想在未来尝试这个。

"I eventually fixed it by first editing the PATH in my system and then doing a --force reinstall of the files. My guess is something went wrong during the initial installation because it worked after I overwrote the previous files, and I noticed some of the files were missing before I did it. Not sure why it didn't work during my initial installation though." “我最终通过首先在我的系统中编辑 PATH 然后对文件进行 --force 重新安装来修复它。我的猜测是在初始安装过程中出了点问题,因为它在我覆盖以前的文件后工作了,我注意到一些在我做之前文件丢失了。不知道为什么在我最初的安装过程中它不起作用。

I hope it's not too late.我希望现在还不算晚。 Have you tried:你有没有尝试过:

npm install aws-amplify

Regards问候

It's been a while, but could you please share your solution in a bit more detail, such as what path was added and when did you add the --force flag?已经有一段时间了,但您能否更详细地分享您的解决方案,例如添加了什么路径以及您何时添加 --force 标志? Sorry my reputation doesn't allow me to make post now对不起,我的名声现在不允许我发帖

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

相关问题 AWS Amplify & React - 未找到模块:无法解析“@aws-amplify/analytics” - AWS Amplify & React - Module not found: Can't resolve '@aws-amplify/analytics' 命令错误“放大配置”:安装错误 aws amplify - Command error “amplify configure” : installation error aws amplify 放大配置 - Amplify configure 放大 React 构建失败,显示“未找到模块:错误:无法解析‘/codebuild/output/src313005886/src/client-portal/src’中的‘./components/...’” - Amplify React build fail with "Module not found: Error: Can't resolve './components/...' in '/codebuild/output/src313005886/src/client-portal/src' " AWS 放大无法解析“@aws-amplify/core” - AWS amplify Can't resolve '@aws-amplify/core' 由于 amplify.ps1 安全问题,命令“amplify configure”无法运行 - command "amplify configure" can not run due to amplify.ps1 security issue 成功安装 Amplify CLI 后运行 amplify configure 时出现错误 - I am getting an error when I ran amplify configure after sucessfully installing Amplify CLI 在AWS Lambda函数中找不到模块 - Can't find module in AWS lambda function Dask Worker 在 AWS 上找不到模块 - Dask Worker can't find module on AWS 找不到模块aws-amplify,lambda函数 - Cannot find module aws-amplify, lambda function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM