首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当试图保存粒子时,获取模块未找到错误

当试图保存粒子时,获取模块未找到错误
EN

Stack Overflow用户
提问于 2022-08-18 19:20:48
回答 1查看 164关注 0票数 0

我试图将particles.js npm添加到我的项目中,但是,当我将脚本添加到App.js并保存时,我得到了下面的错误消息:

./node_modules/react-particles-js/cjs/particles.js 53:14-62中的错误

未找到模块:错误:包路径。/Plugins/PolygonMask/Enum未从Package C:\Users\mekstein\Desktop\facerecognition\node_modules\tsparticles导出(请参阅C:\Users\mekstein\Desktop\facerecognition\node_modules\tsparticles\package.json)中的导出字段)

./node_modules/react-particles-js/cjs/particles.js 482中的错误:14-42

模块未找到:错误:包路径./Enum未从包C:\Users\mekstein\Desktop\facerecognition\node_modules\tsparticles导出(请参阅C:\Users\mekstein\Desktop\facerecognition\node_modules\tsparticles\package.json)中的导出字段)

./node_modules/react-particles-js/cjs/particles.js 484中的错误:14-60

未找到模块:错误:包路径./Plugins/吸收器/Enum未从Package C:\Users\mekstein\Desktop\facerecognition\node_modules\tsparticles导出(请参阅C:\Users\mekstein\Desktop\facerecognition\node_modules\tsparticles\package.json)中的导出字段)

./node_modules/react-particles-js/cjs/particles.js 486中的错误:14-59

未找到模块:错误:包路径./Plugins/Emitters/Enums未从Package C:\Users\mekstein\Desktop\facerecognition\node_modules\tsparticles导出(请参阅C:\Users\mekstein\Desktop\facerecognition\node_modules\tsparticles\package.json)中的导出字段)

这是我的js

代码语言:javascript
复制
import React, {Component} from 'react';
import Particles from 'react-particles-js';
import Navigation from './components/Navigation/Navigation';
import Logo from './components/Logo/Logo';
import ImageLinkForm from './components/ImageLinkForm/ImageLinkForm';
import Rank from './components/Rank/Rank';
import './App.css';

const particlesOptions = {
  particles: {
    line_linked: {
      shadow: {
        enable: true,
        color: "#3CA9D1",
        blur: 5
      }
    }
  }
  
}

  

class App extends Component {
  render() {
  return (
    <div className="App">
     <Particles 
              params={particlesOptions}
            />
       <Navigation />
       <Logo />
       <Rank />
       <ImageLinkForm />
       {/*<FaceRecognition />*/}
    </div>
  );
}
}

export default App;
EN

回答 1

Stack Overflow用户

发布于 2022-08-24 14:29:39

react-particles-js上有一个反对通知:https://github.com/wufe/react-particles-js#warning-deprecation-notice

转而迁移到react-particles (这只是在弃用通知中指定的react-tsparticles的新命名):https://github.com/matteobruni/tsparticles/tree/main/components/react

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73408405

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档