gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.31k forks source link

error An unexpected error occurred: "could not find a copy of webpack to link in \\node_modules\\gatsby-plugin-netlify-cms\\node_modules\\mini-css-extract-plugin\\node_modules". #30753

Closed stevemarksd closed 3 years ago

stevemarksd commented 3 years ago

Description

Getting this error while yarn install (yarn 1.22.10 ) error An unexpected error occurred: "could not find a copy of webpack to link in \\node_modules\\gatsby-plugin-netlify-cms\\node_modules\\mini-css-extract-plugin\\node_modules".

  "dependencies": {
    "path-browserify": "1.0.1",
    "react-helmet": "6.1.0",
    "react-intersection-observer": "8.31.0",
    "process": "0.11.10",
    "@emotion/react": "11.1.5",
    "@emotion/css": "11.1.3",
    "@emotion/styled": "11.1.5",
    "moment": "2.29.1",
    "gatsby": "3.1.2",
    "gatsby-plugin-image": "1.1.2",
    "gatsby-plugin-sharp": "3.1.2",
    "gatsby-transformer-sharp": "3.1.0",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "@types/react": "17.0.3",
    "@types/react-dom": "17.0.3",
    "@reach/router": "1.3.4",
    "webpack": "5.28.0",
    "@types/webpack": "5.28.0",
    "@loadable/component": "5.14.1",
    "@material-ui/core": "4.11.3",
    "@material-ui/icons": "4.11.2",
    "@material-ui/styles": "4.11.3",
    "@types/camelcase-keys": "^4.0.0",
    "@types/query-string": "^6.1.1",
    "@types/rehype-react": "^4.0.0",
    "@types/reach__router": "1.3.7",
    "axios": "^0.18.0",
    "camelcase-keys": "^5.0.0",
    "gatsby-plugin-loadable-components-ssr": "2.1.0",
    "gatsby-react-router-scroll": "4.1.0",
    "graceful-fs": "4.2.6",
    "intersection-observer": "^0.11.0",
    "query-string": "^5.1.1",
    "react-facebook": "^8.1.4",
    "react-youtube": "7.13.0",
    "rehype-react": "6.2.0",
    "schema-dts": "^0.8.2",
    "unified": "^9.1.0",
    "typescript": "4.2.3",
    "gatsby-image": "3.1.0",
    "@hot-loader/react-dom": "17.0.1",
    "gatsby-plugin-material-ui": "3.0.0",
    "gatsby-plugin-catch-links": "3.1.0",
    "gatsby-plugin-emotion": "6.1.0",
    "gatsby-plugin-layout": "2.1.0",
    "gatsby-plugin-manifest": "3.1.0",
    "gatsby-plugin-react-helmet": "4.1.0",
    "gatsby-plugin-sitemap": "3.1.0",
    "gatsby-plugin-typescript": "3.1.0",
    "gatsby-plugin-webpack-bundle-analyser-v2": "1.1.21",
    "gatsby-remark-component": "1.1.3",
    "gatsby-remark-images": "4.1.1",
    "gatsby-source-filesystem": "3.1.0",
    "gatsby-transformer-remark": "3.1.0",
    "netlify-cms-app": "2.14.38",
    "gatsby-plugin-netlify-cms": "5.2.0",
    "gatsby-remark-relative-images": "2.0.2",
    "html-webpack-plugin": "5.3.1",
    "ts-node": "9.1.1",
    "ts-node-dev": "1.1.6"

At this point I can't even install packages.

Steps to reproduce

gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: `gatsby-transformer-remark`,
      options: {},
    },
  ],
}

gatsby-node.js

exports.createPages = async ({actions, graphql}) => {
  const {createPage} = actions
  createPage({
    path: `/404/`,
    component: require.resolve(`./ErrorPage.tsx`),
    context: {},
  })
}

ErrorPage.tsx

import * as React from 'react'

const NotFound = () => {
  return <span>ssssssss</span>
}

export default NotFound

Note:

if we remove

    {
      resolve: `gatsby-transformer-remark`,
      options: {},
    },

changed pages is 0.

Expected result

verbose Found 2 changed pages should be verbose Found 0 changed pages

Actual result

verbose Found 2 changed pages

Environment

"./node_modules/.bin/gatsby" info --clipboard

  System:
    OS: Windows 10 10.0.19041
    CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
  Binaries:
    Node: 14.7.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.7 - C:\Program Files\nodejs\npm.CMD

(this is an old info because gatsby is not even installed.. I can't install it locally anymore with this package)

ascorbic commented 3 years ago

Hi, I'm a bit confused by your steps to reproduce, as they don't appear to match the bug that you're reporting. Is the problem with the number of changed pages, or is it with yarn? If it's the yarn issue, can you provide a reproduction.

LekoArts commented 3 years ago

Hi!

Since we didn't receive an answer for 7 days or more about the ask of a reproduction I'm going to close this now, as we can't do much to help without a reproduction. If you are able to create a minimal reproduction for this then please do answer here or open a new issue with a reproduction. Thanks!