小编Lee*_*seo的帖子

包裹构建错误:插件不是函数

我正在尝试构建一个简单的网络项目

\n

项目结构是这样的

\n
-src\n--index.html\n--index.js\n--style.css\npackage.json\nyarn.lock\n
Run Code Online (Sandbox Code Playgroud)\n

我用这个安装了parcel-bundler

\n

yarn global add parcel-bundler

\n

我运行包裹构建命令

\n

parcel build src/index.html

\n

但此日志后发生了错误

\n
D:\\playground\\js\\sample>parcel build src/index.html\n\xc3\x97  D:\\playground\\js\\sample\\src\\style.css:undefined:undefined: plugin is not a function\n    at LazyResult.run (C:\\Users\\pc\\AppData\\Roaming\\nvm\\v15.14.0\\node_modules\\parcel-bundler\\node_modules\\postcss\\lib\\lazy-result.js:288:14)\n    at LazyResult.asyncTick (C:\\Users\\pc\\AppData\\Roaming\\nvm\\v15.14.0\\node_modules\\parcel-bundler\\node_modules\\postcss\\lib\\lazy-result.js:212:26)\n    at C:\\Users\\pc\\AppData\\Roaming\\nvm\\v15.14.0\\node_modules\\parcel-bundler\\node_modules\\postcss\\lib\\lazy-result.js:254:14 \n    at new Promise (<anonymous>)\n    at LazyResult.async (C:\\Users\\pc\\AppData\\Roaming\\nvm\\v15.14.0\\node_modules\\parcel-bundler\\node_modules\\postcss\\lib\\lazy-result.js:250:23)\n    at LazyResult.then (C:\\Users\\pc\\AppData\\Roaming\\nvm\\v15.14.0\\node_modules\\parcel-bundler\\node_modules\\postcss\\lib\\lazy-result.js:131:17)\n
Run Code Online (Sandbox Code Playgroud)\n

我只是按照包裹官方文档的说明进行操作

\n

我找不到解决方案

\n

请帮我

\n

parcel bundler

7
推荐指数
2
解决办法
1万
查看次数

如何解决 gatsby js 中的依赖错误?

我正在关注 Gatsbyjs 教程。( https://www.gatsbyjs.com/docs/tutorial/part-four/ ) 链接在这里。

我在窗口终端中输入命令,

gatsby new tutorial-part-four https://github.com/gatsbyjs/gatsby-starter-hello-world
cd tutorial-part-four

npm install gatsby-plugin-typography typography react-typography typography-theme-kirkham gatsby-plugin-emotion @emotion/react
Run Code Online (Sandbox Code Playgroud)

但是这些消息发生了错误,

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gatsby-starter-hello-world@0.1.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project
npm ERR!   peer react@"^16.9.0 || ^17.0.0" from gatsby-plugin-typography@3.0.0
npm ERR!   node_modules/gatsby-plugin-typography
npm ERR!     gatsby-plugin-typography@"*" from the root project
npm ERR!   2 more (gatsby, react-dom)
npm …
Run Code Online (Sandbox Code Playgroud)

reactjs gatsby

2
推荐指数
1
解决办法
1139
查看次数

标签 统计

bundler ×1

gatsby ×1

parcel ×1

reactjs ×1