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

bamasure6521's avatar

NPM installation problem In Laravel in Windows 10

My NPM ver is 5.6.0 My Node ver is v8.11.3 Laravel Framework 5.7.12 I have some Problems When i want to install The npm in laravel which are as follows npm install

npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

[email protected] install C:\xampp\htdocs\Newapp\node_modules\node-sass

node scripts/install.js

'node' is not recognized as an internal or external command, operable program or batch file.

npm WARN [email protected] requires a peer of imagemin@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (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! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] install: node scripts/install.js

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the [email protected] install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! C:\Users\bamas\AppData\Roaming\npm-cache_logs\2018-11-07T03_33_04_531Z-debug.log

MY package.json is { "private": true, "scripts": { "dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "npm run development -- --watch", "watch-poll": "npm run watch -- --watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { "axios": "^0.18", "bootstrap": "^4.0.0", "cross-env": "^5.1", "jquery": "^3.2", "laravel-mix": "^2.0", "lodash": "^4.17.5", "popper.js": "^1.12", "vue": "^2.5.17" } }

I already tried everithing like cache clear re installing nodemodules but its not effect.. My NPM is alright Because whenever i run my other Nodejs script it work perfectly....

0 likes
10 replies
D9705996's avatar

'node' is not recognized as an internal or external command, operable program or batch file.

You need to add the nodejs folder to your path. You can test on the command line with (replace the filepath to match your setup)

SET PATH=C:\Program Files\Nodejs;%PATH%
nom jnstall

If this works then you can permanently add the change in

Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables

in "User variables" or "System variables" find variable PATH and add node.js folder path as value as above. If variable doesn't exists, create it.

1 like
bamasure6521's avatar

I m new learning laravel from youtube video

i just change some bg color in _variable.sass file but it not changed

so i want to install npm to reload the saas file by using "npm run dev".... But from the start of installation and run the dev command it show this error "'node' is not recognized as an internal or external command, operable program or batch file." please help me i cant find anything helpful for this error.......

bamasure6521's avatar

@d9705996 i set system variable manually and after u told me i trieed it as administrator but not worked

Can u tell me perfect laravel node js version for perfectly worked....

I used visual studio code and gitbash

i tried both from gitbash and command prompt.... But all result are negetive...... may be i uninstall my node and laravel reinstall it after u told me the perfect match version for both node and laravel...

D9705996's avatar

There isn't a perfect version. The examples I gave were for cmd. If you using git bash try running

export PATH=$PATH:/c/Applications/node

Replacing /c/Applications/node to you path to node.

BinodPalKr's avatar

Open package.json and delete all vite dependencies , In my case it was only two dependencies at the bottom.

and after that run command npm install vite laravel-vite-plugin --save-dev

Please or to participate in this conversation.