我从GitHub克隆了一个fullstack MERN(Typescript)项目,当我在VS code上查看代码时,我注意到软件包到处都有错误,好像它们没有安装,当我想安装它们时,我就是无法安装,并且会出现以下错误,例如使用(npm install express)或任何其他软件包安装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!)

非常感谢.

推荐答案

看看你的.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包的身份验证来获取您的包.获取一个,将其放入支架内,然后重试:)

干杯

Typescript相关问答推荐

Angular 17 Select 错误core.mjs:6531错误错误:NG 05105:发现意外合成监听器@transformPanel.done

如何在方法中定义TypeScript返回类型,以根据参数化类型推断变量的存在?

类型脚本`Return;`vs`Return unfined;`

部分类型化非 struct 化对象参数

TypeScrip-将<;A、B、C和>之一转换为联合A|B|C

类型,其中一条记录为字符串,其他记录为指定的

为什么Typescript不能推断类型?

以Angular 执行其他组件的函数

如何在Angular 服务中制作同步方法?

从类型脚本中元组的尾部获取第n个类型

如何在不违反挂钩规则的情况下动态更改显示内容(带有状态)?

map 未显示控制台未显示任何错误@reaction-google-map/api

为什么类型脚本使用接口来声明函数?他的目的是什么.

如何在TypeScript中描述和实现包含特定属性的函数?

我如何键入它,以便具有字符串或数字构造函数的数组可以作为字符串或数字键入s或n

定义一个只允许来自另一个类型的特定字符串文字的类型的最佳方式

如何使用 Angular 确定给定值是否与应用程序中特定单选按钮的值匹配?

使用 fp-ts 时如何使用 TypeScript 序列化任务执行?

使用嵌套属性和动态执行时,Typescript 给出交集而不是并集

redux-toolkit、createAsyncThunk 错误