我正在尝试构建一个简单的网络项目
\n项目结构是这样的
\n-src\n--index.html\n--index.js\n--style.css\npackage.json\nyarn.lock\nRun Code Online (Sandbox Code Playgroud)\n我用这个安装了parcel-bundler
\nyarn global add parcel-bundler
我运行包裹构建命令
\nparcel build src/index.html
但此日志后发生了错误
\nD:\\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)\nRun Code Online (Sandbox Code Playgroud)\n我只是按照包裹官方文档的说明进行操作
\n我找不到解决方案
\n请帮我
\n我正在关注 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)