我是AWS ec2实例的新手,我尝试在ec2上托管服务器代码--我已经根据以下来自ec2的引用成功地完成了实例设置在ec2 ubuntu服务器上,当我使用npm安装节点模块时,我会得到"npm!node@2.3.18 install:node-gyp rebuild
“错误。我尝试过许多来自StackOverflow的例子,没有人解决我的问题。错误消息如下所示
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-expat@2.3.18 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.18 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2020-10-03T15_56_49_786Z-debug.log
发布于 2020-10-04 17:15:07
发布于 2022-07-05 12:01:14
如果您使用的是最近的macOS或macs,则使用Catalina。在这种情况下,可以使用这些准则在macs中使用gyp:
https://github.com/nodejs/node-gyp/blob/main/macOS_Catalina.md
这为我解决了错误
发布于 2022-10-18 06:25:23
在更新到macOS蒙特雷后,这个问题一直困扰着我。这可能是python和python版本的问题。因此,如果未找到python版本或不匹配,请签入日志。如果场景匹配,那么请执行以下步骤:
$ brew install pyenv
$ pyenv install 3.10.3
$ pyenv global 3.10.3
# Add pyenv to your PATH so that you can reference python
$ echo "export PATH=\"\${HOME}/.pyenv/shims:\${PATH}\"" >> ~/.zshrc
# open a new terminal window and confirm your pyenv version is mapped
$ which python3
$ python3 --version
# Now try to re-run yarn install or npm install
https://stackoverflow.com/questions/64186265
复制相似问题