Skip to content

Error: Cannot find module 'extract-text-webpack-plugin'  #53

Closed
@juanmaguitar

Description

@juanmaguitar

In the package.json there are these scripts..

 "scripts": {
    "clean": "rm -rf ./public/bundle.* ./src/firebase-config.json ./node_modules",
    "build": "npm run clean && npm run createfirebaseconf; NODE_ENV=production webpack -p;",
    "createfirebaseconf": "firebase setup:web --json > ./src/firebase-config.json",
    "serve": "firebase serve"
  },

When doing npm run build it will execute npm run clean which will remove the folder node_modules among other things

Because of this I'm getting this error when doing npm run build

Error: Cannot find module 'extract-text-webpack-plugin'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)

because of course, all dependencies required in webpack.config.js (included this extract-text-webpack-plugin) are not available anymore on node_modules

I've fixed this by simply removing the ./node_modules part of the script

"clean": "rm -rf ./public/bundle.* ./src/firebase-config.json",

What was the purpose of this? Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions