Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cklester's avatar

npm run dev Ends in Error

I'm getting an error after running npm run dev. Can somebody help diagnose, please?

$ npm run dev

> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.output.path: The provided value "public" is not an absolute path!

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v6.10.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script 'node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

0 likes
8 replies
Szyfr's avatar

version of your webpack and laravel mix?

try to downgrade your webpack to 2.2.1

package.json

"devDependencies": {
    "webpack": "2.2.1",
  }
cklester's avatar

@Encrypt I don't even show that dependency in the package.json file. ?!!?!

@david001 I got the same error using that package.json file.

$ npm run watch

> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.output.path: The provided value "public" is not an absolute path!

Should the package.json file include a Webpack dependency reference?

cklester's avatar

@Encrypt Thanks for the help. I did those steps and I'm getting a new error:

$ npm install
C:\Users\c.k.lester\Documents\repos\ttgn
+-- [email protected]  extraneous
+-- [email protected]  extraneous
+-- [email protected]
| `-- [email protected]
|   `-- [email protected]
|     `-- [email protected]
+-- [email protected]  extraneous
+-- [email protected]  extraneous
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.10.1
npm ERR! npm  v3.10.10
npm ERR! path C:\Users\c.k.lester\Documents\repos\ttgn\node_modules\.staging\ajv-4f47c808
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\c.k.lester\Documents\repos\ttgn\node_modules\.staging\ajv-4f47c808' -> 'C:\Users\c.k.lester\Documents\repos\ttgn\node_modules\ajv'
npm ERR!     at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR!     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\c.k.lester\Documents\repos\ttgn\node_modules\.staging\ajv-4f47c808' -> 'C:\Users\c.k.lester\Documents\repos\ttgn\node_modules\ajv'
npm ERR!     at Error (native)
npm ERR!  Error: EPERM: operation not permitted, rename 'C:\Users\c.k.lester\Documents\repos\ttgn\node_modules\.staging\ajv-4f47c808' -> 'C:\Users\c.k.lester\Documents\repos\ttgn\node_modules\ajv'
npm ERR!     at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
npm ERR!     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\c.k.lester\Documents\repos\ttgn\node_modules\.staging\ajv-4f47c808' -> 'C:\Users\c.k.lester\Documents\repos\ttgn\node_modules\ajv'
npm ERR!     at Error (native)
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
cklester's avatar

BTW, why wouldn't the "webpack" dependency already be expressed in the package.json file?

cklester's avatar

npm run dev worked! It censored worked!

I've got "emitted" messages... Wooo hooo!

Please or to participate in this conversation.