2

I use Windows 10. I just installed Laravel 7 and I created a new project using the following command:

composer create-project --prefer-dist laravel/laravel briscola

Then I added the following code in app.scss file to render a red background:

body {
    background-color: red;
}

Then I run the following code to use the current app.scss file:

npm run dev

However unfortunately the previous command didn't work and I saw the following error:

> @ dev C:\xampp\htdocs\briscola
> npm run development

npm WARN invalid config loglevel="notice"

> @ development C:\xampp\htdocs\briscola
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

"cross-env" non è riconosciuto come comando interno o esterno,
 un programma eseguibile o un file batch.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
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.
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\Della Mea Michele\AppData\Roaming\npm-cache\_logs\2020-04-05T15_14_25_432Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev 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\Della Mea Michele\AppData\Roaming\npm-cache\_logs\2020-04-05T15_14_26_197Z-debug.log

Have you any idea about this error and how to solve it?

2
  • I have updated my answer, can you try again? Commented Apr 6, 2020 at 10:33
  • @andy I tried but when I run rm package-lock.json yarn.lock I received rm: cannot remove 'yarn.lock': No such file or directory. Then when I run npm install cross-env I received many warnings.. is it possible that my current version of node (6.11.2) is too old? Finally when I run npm run dev I receive errors after that row: at Object.<anonymous> (C:\xampp\htdocs\briscola\node_modules\cross-env\src\bin\cross-env.js:3:18) npm ERR! code ELIFECYCLE Commented Apr 6, 2020 at 14:19

3 Answers 3

6

actually try this,

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force

Then

npm install cross-env

npm install 

Finally

npm run dev
Sign up to request clarification or add additional context in comments.

1 Comment

I solved... simply I updated node from 6.11.2 to 12.16.1 and then I followed your steps. Thanks a lot!
1

To run npm run dev You should run this command first:

npm install

If any error appears then you should install Node.js first.

Hope it helps :)

1 Comment

I used that command npm install but nothing changed... it appears always the same error.
0

I did all the accepted answers in this thread (and other threads too) but to no avail. What really solved my problem regarding this issue was:

  1. Uninstall my node.js
  2. Manually delete all npm and node_modules folder in my C:\Program Files (or wherever you might have installed it because 'uninstalling' sometimes won't delete data folders)
  3. Made sure I removed the file path C:\Users\ACER\AppData\Roaming\npm on my Environment Variables
  4. Downloaded this node version for my Windows 7 LINK HERE then installed it freshly. Important: Don't forget to restart your computer after the installation!

These steps were successful and you can try it if above answers don't work.

Now when I rechecked my versions, they are now fine and working and won't give errors.

$ npm -v
6.13.4

$ node -v
v13.6.0

$ npx -v
6.13.4

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.