我安装了一个react应用程序,遇到了一些问题。我试图通过删除/node-modules
并重新安装来修复它,但它仍然给我带来了一些问题。我是ubuntu用户。请帮我做这个。这是错误日志
suraj@suraj-Inspiron-15-3567:~/Documents/memories_project/client$ npm install axios npm WARN react-file-base64@1.0.3 requires a peer of react@^15.0.2 but none is installed. You
must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3
(node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.2.1 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.2.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ axios@0.21.1
updated 1 package and audited 1841 packages in 17.99s
124 packages are looking for funding
run `npm fund` for details
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
对等依赖关系不再自动安装,因此您必须自己安装它们你可以按照以下步骤
- 删除"package-lock.json"文件
- 在终端中,转到项目所在的文件夹,然后键入
npm install --save-dev typescript react
- 然后键入
npm install
或者在您的包JSON中,在devDependencies中添加所需版本的typescript,并遵循与上面相同的步骤,除了第2点
"typescript": "^2.8.0"
//same for react
点击此处了解更多
据我所知,你的package.json文件tho似乎有问题。