每次我尝试像往常一样使用“yarn start”启动我的项目时,我都会得到“Command failed with exit code 127”错误。我已经意识到我开始得到这个错误,一旦我更新我的iOS到蒙特利v12.6.1。我的节点版本与它看起来的yarn不兼容。
我试过什么来解决这个问题:
- 我已尝试升级/更新我的节点版本。
- 我已经手动卸载了node/npm和yarn,并使用node版本16.0.0重新安装它们
- 我已经删除了node_modules和package_lock.json
- 我已经运行了命令“yarn”和其他所有更新/升级命令
我尝试过的一切都失败了。
以下是Yarn错误日志:
Yarn version:
1.22.10
Node version:
15.7.0
Platform:
darwin x64
Trace:
Error: getaddrinfo ENOTFOUND registry.yarnpkg.com
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:69:26)
npm manifest:
{
"name": "web",
"version": "0.1.0",
"homepage": "https://danibis.github.io/",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"cors": "^2.8.5",
"express": "^4.17.2",
"focus-trap-react": "^8.9.1",
"leaflet": "^1.8.0",
"node-sass": "^6.0.1",
"nodemailer": "^6.7.2",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-leaflet": "^4.0.0",
"react-scripts": "4.0.3",
"styled-components": "^5.3.3",
"web-vitals": "^1.0.1",
"webpack-hot-middleware": "^2.25.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "yarn run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": [
">0.2%",
"not dead",
"not op_mini all"
]
}
yarn manifest:
No manifest
Lockfile:
No lockfile
任何其他想法如何解决这个问题将不胜感激。
谢谢你的时间!
1条答案
按热度按时间kqlmhetl1#
我找到解决办法了
使用nvm将npm的版本切换到最新版本(当时是19.0.0)并运行“yarn install”。这就解决了问题!