G3ORG3's avatar

npm run dev error with LESS

Hey, I have problem with npm run dev when using less

I have fresh instalation of laravel

I changed my webpack.mix.js to this:

mix.js('resources/assets/js/app.js', 'public/js') .less('resources/assets/less/app.less', 'public/css');

then i run npm install and when u run npm run dev i get this error:

@ dev C:\Users\G3ORG3\Desktop\lol npm run development

@ development C:\Users\G3ORG3\Desktop\lol cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

Additional dependencies must be installed. This will only take a moment. 'yarn' is not recognized as an internal or external command, operable program or batch file. child_process.js:533 throw err; ^

Error: Command failed: yarn add less-loader less --save-dev 'yarn' is not recognized as an internal or external command, operable program or batch file.

at checkExecSyncError (child_process.js:490:13)
at execSync (child_process.js:530:13)
at Function.dependency (C:\Users\G3ORG3\Desktop\lol\node_modules\laravel-mix\src\Verify.js:107:13)
at Api.less (C:\Users\G3ORG3\Desktop\lol\node_modules\laravel-mix\src\Api.js:118:16)
at Object.<anonymous> (C:\Users\G3ORG3\Desktop\lol\webpack.mix.js:15:5)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)

npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\G3ORG3\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "development" npm ERR! node v7.5.0 npm ERR! npm v4.1.2 npm ERR! code ELIFECYCLE npm ERR! @ development: cross-env 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 @ development script 'cross-env 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! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.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.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\G3ORG3\Desktop\lol\npm-debug.log

npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\G3ORG3\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "dev" npm ERR! node v7.5.0 npm ERR! npm v4.1.2 npm ERR! code ELIFECYCLE npm ERR! @ dev: npm run development npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ dev script 'npm run development'. 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! npm run development 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.

npm ERR! Please include the following file with any support request: npm ERR! C:\Users\G3ORG3\Desktop\lol\npm-debug.log

pleaseeeee any help? thanks!!

0 likes
5 replies
olshevsky's avatar

Hey, try to add yarn package to your project package.json

Like:

"devDependencies": {
    ...
    "yarn": "*"
}

And run:

npm install

Works for me.

Jaytee's avatar

Add yarn globally, not like what the user above said

npm install -g yarn
olshevsky's avatar

Yes of course, if you will use yarn in another projects, you can install it globally. If not, there is no reason to install it globally.

Jaytee's avatar

Installing Yarn globally is more of value than installing it for just one project. And, the likelihood of OP having just one project is low.

  • Yarn in my opinion, is faster and less strict (which has it's pros)
sdevilcry's avatar

Not agree with your thought. Yarn or other package managers shouldn't be installed globally if you don't want to.

I have NPM globally but I don't want Yarn so I'm gonna use the -D option to avoid having more junk file in my file system :)

Please or to participate in this conversation.