how can I run "npm install && npm run dev on laravel 7? - laravel

i got this error when run command "npm install && npm run dev" on my project.
I have tried to run the command "npm install" and i get the other error.
enter image description here

You have to run:
npm install; npm run dev
The && operation in CLI only works in CMD on Windows. In Powershell you have to use a semicolon instead.

First try to update your nodejs version
npm install -g node
And then install cross-env globally
npm install --global cross-env
Finally install latest autoprefixer or 9.8.0 and run dev
npm install autoprefixer#9.8.0
npm install && run dev

The error you are getting is due to && operation in CLI, first of all, you have to install all dependencies using npm install and then you are allowed to run dev mode.
For real-time compiling you can use npm run watch instead of npm run dev.
Make sure you have installed node.js within your pc.

Related

Cant run cypress using UI

I can run my scripts using editor in headless mode but scripts are failing when tried to run using cypress UI
Getting error
From Node.js Internals:Error: socket hang upat connResetException (node:internal/errors:690:15)at Socket.socketOnEnd (node:_http_client:471:24)at Socket.emit (node:events:406:36)at endReadableNT (node:internal/streams/readable:1331:13)at processTicksAndRejections (node:internal/process/task_queues:83:22)
Try to upgrade cypress version from 9.4.1. to 10.1.0 but again getting error
PS C:\Users\hshah\cypress> npm install --save-dev cypress#10.0.3
npm ERR! must provide string spec
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\hshah\AppData\Local\npm-cache_logs\2022-06-20T05_10_05_825Z-debug.log
PS C:\Users\hshah\cypress>
Not sure what can be the reason?
Remove your package-lock.json file and node_modules folder.
In your package.json, change the cypress version to 10.1.0
Run the command npm cache clean --force
Then run the command npm install. This will install all the dependencies listed in your package.json file.

How can i install Serverless on a Mac?

I am running sudo npm install -g serverless.
Error:
npm WARN deprecated mkdirp#0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! Unexpected end of JSON input while parsing near '...:{"name":"#babel/pars'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/AC/.npm/_logs/2020-03-30T21_11_07_100Z-debug.log
If you are using Windows:
Open Windows Powershell as admin
npm cache clean --force: Clear cache
If you are using Linux/Mac:
sudo -i: For admin privileges
npm cache clean --force
Use this:
sudo npm install -g --unsafe-perm=true --allow-root serverless

Running Vapor from Homestead failds

I installed Vapor in a brand new Laravel up. When I try to run 'vapor deploy production' I get this error:
Running Command: npm ci && npm run prod && rm -rf node_modules
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm#5 or later to generate it, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-10-23T21_24_09_128Z-debug.log
In Process.php line 254:
The command "npm ci && npm run prod && rm -rf node_modules" failed.
Exit Code: 1(General error)
Working directory: /home/vagrant/code/sales2/.vapor/build/app
Output:
================
Error Output:
================
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVers
ion >= 1. Run an install with npm#5 or later to generate it, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-10-23T21_24_09_128Z-debug.log
I sucessfully installed vapor. Created a new project and left the domain setting at default.
You didn't specify what your host operating system was, but I assume it's windows, when you ran "vagrant up" did you do so as administrator?
That said, this is an issue with npm and not Vapor. I'd running the "npm ci && npm run prod && rm -rf node_modules" command ssh'd into your vagrant console and troubleshoot from there.
You may not have configured the node package manager for this project. From your computer and not the homestead if you are using, run this command
<project directory>: npm install
This will create the necessary file.

getting error while install any npm module

I getting this error while install any module from npm and also not work with yarn.
I don't know where is the problem!
Update NPM like :
npm update
Also i suggest you do with -g
"npm update -g" it will update globally installed packages.

SASS installation with Grunt

I ran
npm install --save-dev to install dev dependencies, which finished successfully but why there is no entry shown in package.json related to this command.
I just checked that if I removed "-g" option from the command
npm install -g grunt --save-dev it works properly -
so basically removing the global option from the command it is updating the package.json correctly.

Resources