简体   繁体   English

'react' - 运行 npm start 后,它给出 ./src/index.js Module not found: Can't resolve 'react' in 'C:\\Users\\...\\src' 错误

[英]'react' - After run npm start it gives ./src/index.js Module not found: Can't resolve 'react' in 'C:\Users\...\src' error

In reactJs after run运行后在 reactJs 中

npm start启动

it gives它给

./src/index.js Module not found: Can't resolve 'react' in 'C:\\Users...\\src' ./src/index.js 模块未找到:无法解析“C:\\Users...\\src”中的“react”

error.错误。

this is my package.js这是我的 package.js

{
  "name": "client-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@aspnet/signalr": "^1.0.4",
    "react": "^16.5.2",
    "react-dom": "^16.5.2",
    "react-scripts": "^1.1.5"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

尝试删除package-lock.json ,运行npm install然后再次运行npm start

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 'react' - 运行 npm start 后,它给出 ./src/contentful.js 找不到模块:无法解析 'C:\\Users\\..\\my-blog\\src' 中的 'contenful' - 'react' - After run npm start it gives./src/contentful.js Module not found: Can't resolve 'contenful' in 'C:\Users\..\my-blog\src' ./src/index.js 找不到模块:无法解析“c:\users\.....”中的“react-dom/client” - ./src/index.js Module not found: Can't resolve 'react-dom/client' in "c:\users\....." 如何解决 /src/index.js 未找到模块:无法解析 'C:\Users\hp\weather\src' 中的 './serviceWorker' - how to resolve /src/index.js Module not found: Can't resolve './serviceWorker' in 'C:\Users\hp\weather\src' 未能编译./src/index.js找不到模块:无法在 - Failed to compile ./src/index.js Module not found: Can't resolve 'react' in 如何修复“./src/index.js Module not found: Can't resolve 'loadash” in my react app? - How to fix "./src/index.js Module not found: Can't resolve 'loadash" in my react app? ./src/index.js 未找到模块:无法解析“aws-amplify”React - ./src/index.js Module not found: Can't resolve 'aws-amplify' React 找不到入口模块:错误:无法解析'./src/index.js' - Entry module not found: Error: Can't resolve './src/index.js' ./src/components/index.js找不到模块:无法解析“ / src / components”中的“ ./{Component}” - ./src/components/index.js Module not found: Can't resolve './{Component}' in '/src/components' [React Webpack]:找不到模块:错误:无法解析 'C:\Users\...' 中的 'src/views/UserList' - [React Webpack]: Module not found: Error: Can't resolve 'src/views/UserList' in 'C:\Users\…' ./src/index.js 找不到模块:无法解析'~antd/dist/antd.css' - ./src/index.js Module not found: Can't resolve '~antd/dist/antd.css'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM