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

successdav's avatar

Please Help Am stuck! npm install not working

when I run npm install, it doesnot work, it only returns errors I have npm 6.4.1 installed and node v8.11.4 installed. I am using homestead.

vagrant@homestead:~/Sites/success_techmax$ npm install
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed.
 You must install peer dependencies yourself.
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.

audited 11710 packages in 89.727s
found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

and when i use npm run dev


> @ dev /home/vagrant/Sites/success_techmax
> npm run development


> @ development /home/vagrant/Sites/success_techmax
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress
--hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

sh: 1: cross-env: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin
/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/we
bpack.config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2018-12-07T23_34_26_478Z-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 log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2018-12-07T23_34_26_580Z-debug.log
vagrant@homestead:~/Sites/success_techmax$

I have tried using npm downgrading npm to 5.6 and still get thesame result

thanks for your help

0 likes
4 replies
Braunson's avatar

Looks like cross-env wasn't found. There may be more additional data in your log /home/vagrant/.npm/_logs/2018-12-07T23_34_26_478Z-debug.log

Run these commands..

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

That should solve the problem. If not there's a Laravel Mix thread here that may help https://github.com/JeffreyWay/laravel-mix/issues/478

successdav's avatar

this is what i get when i run npm install cross-env

vagrant@homestead:~/Sites/success_techmax$ npm install cross-env
npm WARN rollback Rolling back [email protected] failed (this is probably harmless)
: ETXTBSY: text file is busy, unlink '/home/vagrant/Sites/success_techmax/node_m
odules/cross-env/node_modules/nice-try/package.json.655397791'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): E
TXTBSY: text file is busy, unlink '/home/vagrant/Sites/success_techmax/node_modu
les/cross-env/node_modules/isexe/package.json.781588350'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless)
: ETXTBSY: text file is busy, unlink '/home/vagrant/Sites/success_techmax/node_m
odules/cross-env/node_modules/path-key/package.json.2279246246'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless):
ETXTBSY: text file is busy, unlink '/home/vagrant/Sites/success_techmax/node_mod
ules/cross-env/node_modules/semver/package.json.4024446856'
npm WARN rollback Rolling back [email protected] failed (this is probably harm
less): ETXTBSY: text file is busy, unlink '/home/vagrant/Sites/success_techmax/n
ode_modules/cross-env/node_modules/shebang-regex/package.json.4256856974'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless
): ETXTBSY: text file is busy, unlink '/home/vagrant/Sites/success_techmax/node_
modules/cross-env/package.json.2276362188'
npm WARN rollback Rolling back [email protected] failed (this is probably ha
rmless): ETXTBSY: text file is busy, unlink '/home/vagrant/Sites/success_techmax
/node_modules/cross-env/node_modules/shebang-command/package.json.1148501251'
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): E
TXTBSY: text file is busy, unlink '/home/vagrant/Sites/success_techmax/node_modu
les/cross-env/node_modules/which/package.json.2648587717'
npm WARN rollback Rolling back [email protected] failed (this is probably harmles
s): ETXTBSY: text file is busy, unlink '/home/vagrant/Sites/success_techmax/node
_modules/cross-env/node_modules/is-windows/package.json.2300162320'
npm WARN rollback Rolling back [email protected] failed (this is probably harmle
ss): ETXTBSY: text file is busy, unlink '/home/vagrant/Sites/success_techmax/nod
e_modules/cross-env/node_modules/cross-spawn/package.json.2412108220'
npm ERR! path /home/vagrant/Sites/success_techmax/node_modules/cross-env/package
.json.2276362188
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename
npm ERR! ETXTBSY: text file is busy, rename '/home/vagrant/Sites/success_techmax
/node_modules/cross-env/package.json.2276362188' -> '/home/vagrant/Sites/success
_techmax/node_modules/cross-env/package.json'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2018-12-08T00_08_16_616Z-debug.log
vagrant@homestead:~/Sites/success_techmax$

successdav's avatar

am I the only one going through this problem? why is everyone skipping this problem? please help me out guys, I have been stuck here for 2days. please

Please or to participate in this conversation.