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

RushVan's avatar

Spark npm run dev error

I am getting this error when I run >npm run dev

cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress

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

  • configuration.output.path: The provided value "public" is not an absolute pat npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ dev: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ dev script 'cross-env NODE_ENV=development node_modules ig.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! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls npm ERR! There is likely additional logging output above.

I have NPM 4.4.4 and Node 6.10.1 installed.

Any ideas?

0 likes
3 replies
DaveBagler's avatar

I would likely need to see your weback.mix.js file to be more helpful but from the first line of the error message: ...The provided value "public" is not an absolute pat... it looks like somewhere in your webpack.mix.js you're providing a relative path and webpack is looking for an absolute path. So taking a look at the webpath.mix.js file that comes with spark, at the top it pulls in the path module:

var path = require('path');

and later in the file when getting the spark js files it resolves a relative path to an absolute path:

path.resolve(__dirname, 'vendor/laravel/spark/resources/assets/js'),
Nash's avatar

The path node_modules/webpack/bin/webpack.js was node_modules/webpack/dist/bin/webpack.js at some point. Just update this path in your package.json file accordingly.

DeveloDesign's avatar

I had this same error when trying to install using both the spark-installer and composer.

During the "spark new project-name" command I didn't notice that it showed an error as it did continue with the installation but didn't complete correctly.

The following error was visible,

sh: composer: command not found

The error was due to how composer was installed on my local machine and was aliased, If I ran "type composer" It would return.

composer is aliased to `php /usr/local/bin/composer.phar'

I then changed this with the following command,

mv /usr/local/bin/composer.phar /usr/local/bin/composer

now when I run "type composer"

composer is aliased to `php /usr/local/bin/composer'

Now when I run "spark new project-name" it correctly installs all of the dependancies including the cross-env module and all other spark requirements.

Please or to participate in this conversation.