我知道这是一个反复出现的问题,但是在一个普通的js项目中呢?
我在我的一个项目中没有使用Typescript,但是当我在模块中导入geoplug时,我仍然在Eclipse中得到count not find declaration file for module
。
import { getGeo } from 'geoplugin';
这是一个React/Redux前端。没有@types/geoplugin包。我怎样才能消除这个错误呢?
请注意,此错误仅在Eclipse上报告。
编辑
我的package.json是这样的:
{
"name": "myproj",
"version": "0.0.1",
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^1.6.1",
"axios": "^0.27.2",
"bootstrap": "^5.2.1",
"classnames": "^2.2.6",
"clientjs": "^0.2.1",
"date-fns": "^2.12.0",
"geoplugin": "^1.0.10",
"jsonwebtoken": "^8.5.1",
"react": "^17",
"react-dom": "^17",
"react-redux": "^7.2.4",
"react-router-dom": "^5.1.2",
"react-scripts": "^4",
"sass": "^1.49.0",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^2.1.1"
},
"scripts": {
"start": "cp environment/.env . && react-scripts --openssl-legacy-provider start",
"build": "cp environment/.env.production .env && react-scripts --openssl-legacy-provider build && cp httpd_conf/.htaccess build/",
"buildAndDeploy": "cp environment/.env.production .env && react-scripts build && cp httpd_conf/.htaccess build/ && /vagrant/frontend/publicar",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"prettier": "^2.0.2"
}
}
1条答案
按热度按时间gkl3eglg1#
我复制了您项目的简化版本,一切正常
这个错误没有意义,尝试删除您的
node_modules
和您的package-lock.json
然后,再次安装所有软件包:
如果这不起作用,查看
package.json
内部的内容将非常有帮助