Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提示:无法找到模块“react-slider-light”的声明文件。 #18

Open
Vegetables-Bird opened this issue Jan 13, 2020 · 1 comment

Comments

@Vegetables-Bird
Copy link

import Slider from 'react-slider-light';里提示以下信息:
module "c:/budiler/kaiyuanzyWeb/ky-web/node_modules/react-slider-light/lib/index"
无法找到模块“react-slider-light”的声明文件。“c:/budiler/kaiyuanzyWeb/ky-web/node_modules/react-slider-light/lib/index.js”隐式拥有 "any" 类型。
Try npm install @types/react-slider-light if it exists or add a new declaration (.d.ts) file containing declare module 'react-slider-light';ts(7016)

请问这个要怎么弄,是按提示输入npm install @types/react-slider-light`这个指令吗?

@Vegetables-Bird
Copy link
Author

用yarn运行后看到的提示是:
`PS C:\budiler\kaiyuanzyWeb\ky-web> yarn start
yarn run v1.21.1
$ node scripts/start.js
internal/modules/cjs/loader.js:800
throw err;
^

Error: Cannot find module 'resolve'
Require stack:

  • C:\budiler\kaiyuanzyWeb\ky-web\config\webpack.config.js
  • C:\budiler\kaiyuanzyWeb\ky-web\scripts\start.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (C:\budiler\kaiyuanzyWeb\ky-web\config\webpack.config.js:6:17)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\budiler\kaiyuanzyWeb\ky-web\config\webpack.config.js',
    'C:\budiler\kaiyuanzyWeb\ky-web\scripts\start.js'
    ]
    }
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    yarn run v1.21.1iyuanzyWeb\ky-web> yarn move react-slider-light
    error Command "move" not found.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

是指要在webpack里配置一些代码吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant