0

I am trying to run 'npm run build' in the terminal of parser written in React. But whenever I do this I get an error inline

> matrix@1.0.0 build E:\work\Parser\parser
> ./node_modules/webpack-cli/bin/cli.js --mode=development

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! matrix@1.0.0 build: `./node_modules/webpack-cli/bin/cli.js --mode=development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the matrix@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\criti\AppData\Roaming\npm-cache\_logs\2019-12-18T08_21_16_082Z-debug.log

This happens only in windows. When i searched for the

./node_modules/webpack-cli/bin/cli.js --mode=development

in package.json I found this to be written as

    "build": "./node_modules/webpack-cli/bin/cli.js --mode=development",
    "build:dev": "./node_modules/webpack-cli/bin/cli.js --mode=developement",
    "build:prod": "./node_modules/webpack-cli/bin/cli.js --mode=production",
    "build:watch": "./node_modules/webpack-cli/bin/cli.js --watch",
    "build-server": "./node_modules/webpack-cli/bin/cli.js ./parser.js -o ./parser_server.bundle.js --target='node'",

What is this issue ?

ZachB
  • 13,051
  • 4
  • 61
  • 89
Ritik Singh
  • 364
  • 3
  • 15

2 Answers2

0

You don't need to put ./node_modules/webpack-cli/bin/ on each command, simply put webpack --mode development.

0

Assuming you have npx installed, try this in the command line: npx webpack --mode=development

Siri
  • 1,117
  • 6
  • 13