我从GitHub克隆了一个完整堆栈MERN (Typescript)项目,当我在VS代码上签出代码时,我注意到软件包到处都有错误,就好像它们没有安装一样。当我想安装它们时,我就是不能,并且会得到以下错误,例如安装express ()或任何其他包:
npm WARN idealTree Removing dependencies.@types/node in favor of devDependencies.@types/node
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@designed-and-developed%2feslint-config-prettier-typescript-react - Not found
npm ERR! 404
npm ERR! 404 '@designed-and-developed/eslint-config-prettier-typescript-react@^1.0.9' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
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帐户和登录它有关,但我不想这样做,我只想能够在本地运行这个网站,同时避免我在卸载的软件包上遇到的错误。我怎么能这么做?
这是我的package.json:
{
"name": "lofi-env",
"version": "1.0.0",
"main": "index.js",
"repository": "https://github.com/ni-xon/lofi-env.git",
"author": "ni-xon <nixonuch_@outlook.com>",
"license": "MIT",
"scripts": {
"server": "nodemon --config nodemon.json backend/server.ts",
"client": "yarn --cwd frontend start",
"start": "yarn server",
"dev": "concurrently \"yarn server\" \"yarn client\"",
"heroku-postbuild": "cd frontend && npm install && npm run build"
},
"devDependencies": {
"@designed-and-developed/eslint-config-prettier-typescript-react": "^1.0.9",
"eslint": "^8.10.0",
"prettier": "^2.5.1"
},
"dependencies": {
"@types/bcrypt": "^5.0.0",
"@types/express": "^4.17.13",
"@types/jsonwebtoken": "^8.5.8",
"@types/mongoose": "^5.11.97",
"@types/node": "^17.0.21",
"bcrypt": "^5.0.1",
"concurrently": "^7.0.0",
"dotenv": "^16.0.0",
"express": "^4.17.3",
"express-async-handler": "^1.2.0",
"jsonwebtoken": "^8.5.1",
"mongoose": "^6.2.4",
"nodemon": "^2.0.15",
"ts-node": "^10.7.0",
"typescript": "^4.6.2"
}
}事实上,每当我调用NPM时(即使是在我安装NPM时,我也会得到这个错误!)
谢谢。
发布于 2022-07-02 15:05:18
看看你的.npmrc:
registry=https://registry.yarnpkg.com/
@designed-and-developed:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
always-auth=true这里没有NPM令牌,所以您不能通过Github包进行身份验证来获取您的包。获取一个,将其放入大括号中,然后重试:)
干杯
https://stackoverflow.com/questions/72839605
复制相似问题