我目前正在尝试遵循有关如何克隆谷歌地图的教程,现在我已经完成了构建,然后我尝试运行 npm start 命令,但当我这样做时,我收到以下错误:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\mikai\OneDrive\Skrivebord\Code\websites\Maps\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open
'C:\Users\example\example\example\example\example\example\example'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
我已经尝试通过运行命令 npm cache clean 来清除缓存,然后运行 npm start 但我仍然遇到相同的错误是否有人遇到过相同的错误并找到了解决方案?
这里是教程的链接:https://javascript.plainenglish.io/build-a-google-maps-clone-in-less-than-20-minutes-6f7c68db13e
这是 package.json 文件:
{
"name": "google-maps-clone",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.1.2"
},
"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"
]
}
}
最佳答案
尝试删除package-lock.json
。
删除此文件后,使用npm install
命令。
关于javascript - npm 找不到文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69497500/