I try to execute an old react app which is created by myself two years ago. When I try to run the app via "npm install", I've got the following error:
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
The dependencies of my package.json file:
"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"
}
My current node and npm version:
node -v v16.13.1
npm -v 8.1.2
I suppose this error is due to the old dependencies but I don't find any useful workaround to solve this problem. After I've removed node_modules I still can re-install node_modules. Thank you for your help.
Running rm -rf node_modules && rm -f package-lock.json && npm i
in a bash terminal fixed it for me.
Running npm -v
yields --> 8.3.0
on my local machine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With