【发布时间】:2019-09-09 19:07:04
【问题描述】:
我正在尝试查找由名为 react-gauge-chart 的包引起的打包问题。 安装后,显示错误“找不到模块”。我想知道这个问题背后的原因。
这个问题发生在我的本地以及codesandbox example。
这是我本地的错误:
Failed to compile.
./src/views/home/CorrectiveMaintainanceReport.jsx
Module not found: Can't resolve 'react-gauge-chart' in '/Users/kongwenyao/Documents/GitLab/wefix/src/views/home'
这是来自 Codesandbox 的错误:
Error
Could not fetch dependencies, please try again in a couple seconds: Something went wrong while packaging the dependency react-gauge-chart@0.1.2: ENOENT: no such file or directory, scandir '/tmp/3739059402/node_modules/react-gauge-chart/dist'
我在 package.json 中的本地依赖项
"dependencies": {
"axios": "^0.18.0",
"chart.js": "2.7.3",
"classnames": "2.2.6",
"eslint-config-google": "^0.12.0",
"moment": "2.24.0",
"node-sass": "4.11.0",
"nouislider": "13.1.1",
"react": "16.8.4",
"react-chartjs-2": "2.7.4",
"react-copy-to-clipboard": "5.0.1",
"react-datetime": "2.16.3",
"react-dom": "16.8.4",
"react-gauge-chart": "^0.1.2",
"react-google-maps": "9.4.5",
"react-router-dom": "4.3.1",
"react-scripts": "2.1.8",
"reactstrap": "7.1.0"
},
【问题讨论】:
标签: javascript reactjs npm yarnpkg