相关疑难解决方法(0)

npm install 收到错误“必须提供字符串规范”

我尝试执行两年前我自己创建的一个旧的 React 应用程序。当我尝试通过“npm install”运行应用程序时,出现以下错误:

npm ERR! must provide string spec
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\tws80\AppData\Local\npm-cache\_logs\2022-01-09T21_00_13_180Z-debug.log
Run Code Online (Sandbox Code Playgroud)

我的 package.json 文件的依赖项:

  "dependencies": {
    "@material-ui/core": "^4.9.7",
    "@material-ui/icons": "^4.9.1",
    "@mdi/js": "^5.0.45",
    "@mdi/react": "^1.3.0",
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.4.1",
    "@testing-library/user-event": "^7.2.1",
    "editor.formatOnPaste": true,
    "editor.formatOnSave": true,
    "husky": "^4.2.3",
    "i18next": "^19.3.3",
    "lint-staged": "^10.0.8",
    "prettier": "^1.19.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2", 
    "react-html-email": "^3.0.0",
    "react-i18next": "^11.3.3",
    "react-intl": "^4.1.1",
    "react-router-dom": "^5.1.2",
    "react-scripts": "^5.0.0"
  }
Run Code Online (Sandbox Code Playgroud)

我当前的节点和 npm 版本:

node -v v16.13.1
npm -v 8.1.2 …
Run Code Online (Sandbox Code Playgroud)

node.js reactjs

24
推荐指数
4
解决办法
4万
查看次数

标签 统计

node.js ×1

reactjs ×1