Skip to content

"TypeError: Cannot read property 'properties' of undefined" webpack-cli error fix #2

@cfree

Description

@cfree

I ran npm run dev and got this error:

...
> webpack --env build

/Learning-JavaScript-Data-Structures-and-Algorithms-Third-Edition/LearningJavaScriptDataStructuresandAlgorithmsThirdEdition_Code/node_modules/webpack-cli/bin/config-yargs.js:136
				describe: optionsSchema.definitions.output.properties.path.description,
				                                           ^

TypeError: Cannot read property 'properties' of undefined
    at module.exports (/Learning-JavaScript-Data-Structures-and-Algorithms-Third-Edition/LearningJavaScriptDataStructuresandAlgorithmsThirdEdition_Code/node_modules/webpack-cli/bin/config-yargs.js:136:48)
    at /Learning-JavaScript-Data-Structures-and-Algorithms-Third-Edition/LearningJavaScriptDataStructuresandAlgorithmsThirdEdition_Code/node_modules/webpack-cli/bin/webpack.js:66:27
    at Object.<anonymous> (/Learning-JavaScript-Data-Structures-and-Algorithms-Third-Edition/LearningJavaScriptDataStructuresandAlgorithmsThirdEdition_Code/node_modules/webpack-cli/bin/webpack.js:521:3)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)
    at Module.require (internal/modules/cjs/loader.js:650:17)
    at require (internal/modules/cjs/helpers.js:20:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! javascript-datastructures-algorithms@0.0.1 webpack: `webpack --env build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the javascript-datastructures-algorithms@0.0.1 webpack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/cfree/.npm/_logs/2018-12-15T18_04_10_202Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command

I updated to 3.x of webpack-cli, which resulted in this error:

...
> webpack --env build

/Learning-JavaScript-Data-Structures-and-Algorithms-Third-Edition/LearningJavaScriptDataStructuresandAlgorithmsThirdEdition_Code/node_modules/webpack-cli/bin/cli.js:244
				throw err;
				^

Error: Cannot find module 'uglifyjs-webpack-plugin'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
    ...

I ran npm install -D uglifyjs-webpack-plugin and it worked! 🎉

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