【发布时间】:2021-10-16 22:48:27
【问题描述】:
我只是从 github 克隆我的项目,但是当我运行 npm install 时,发生了错误。
这个项目在我的电脑上完美运行。但是,它甚至无法在我的 linux 笔记本电脑上初始化。有什么解决办法吗?
这是错误信息,
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@testing-yarnlibrary%2freact - Not found
npm ERR! 404
npm ERR! 404 '@testing-yarnlibrary/react@^11.1.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/anthonyzhang/.npm/_logs/2021-08-13T17_45_59_614Z-debug.log
package.json,
{
"name": "qrcode-ordering",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-yarnlibrary/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"bootstrap": "^5.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
"css-loader": "^6.2.0",
"style-loader": "^3.2.1"
}
}
【问题讨论】:
-
读取它正在寻找的包的名称 - 这似乎不对,检查包中的内容并锁定文件。
-
@jonrsharpe 我也注意到了。这是我在
package.json, ``` "@testing-yarnlibrary/react": "^11.1.0" ``` 中的依赖,这就是yarn.lock,"@testing-library/react@^11.1.0": version "11.2.7" resolved "https://registry.npmjs.org/@testing-library/react/-/react-11.2.7.tgz" integrity sha512-tzRNp7pzd5QmbtXNG/mhdcl7Awfu/Iz1RaVHY75zTdOkmHCuzMhRL83gWHSgOAcjS3CCbyfwUHMZgRJb4kAfpA== dependencies: "@babel/runtime" "^7.12.5" "@testing-library/dom" "^7.28.1" -
这显然不是现有包的名称,所以你为什么不修复它,看看是否能解决问题?
-
谢谢!我相信它现在正在工作。
标签: npm npm-install yarnpkg yarn-lock.json