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

clat23's avatar

npm install, npm audit fix errors out

It all started with trying to install the videojs-youtube package (https://github.com/videojs/videojs-youtube). I don't even remember the error I was getting at this point. I think it was trying to write to a file that did not exist.

I then performed an npm audit which resulted in this in several moderate issues, over a hundred high issues and one critical issue. I then attempted to do an npm audit fix which resulted in files needing to be moved away from the node_modules/.bin folder. Each time I moved a file it would ask for another file to be moved. I did this for about 15 files then I gave up moving files away.

After some searching on Google, I tried a solution that had me deleting my node_modules folder then running npm install. This resulted in this error:

npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This module relies on Node.js's internals and will break at some point. Do not use it, and update to [email protected].
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: I wrote this module a very long time ago; you should use something else.
npm WARN deprecated [email protected]: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm ERR! path /home/vagrant/Code/dsa/node_modules/ansi-styles/node_modules/color-name/package.json.1267071519
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/Code/dsa/node_modules/ansi-styles/node_modules/color-name/package.json.1267071519'
npm ERR! enoent This is related to npm not being able to find a file.

I also tried deleting package-lock.json and resulted in a similar result as above, just with a different file on the no such file or directory error.

Here is my package.json:

{
  "private": true,
  "devDependencies": {
    "gulp": "^3.8.8"
  },
  "dependencies": {
    "bootstrap": "^3.0.0",
    "chart.js": "^2.7.1",
    "jquery": "^2.1.4",
    "js-cookie": "^2.1.0",
    "laravel-elixir": "^6.0.0-11",
    "laravel-elixir-vue-2": "^0.2.0",
    "laravel-elixir-webpack-official": "^1.0.2",
    "moment": "^2.10.6",
    "promise": "^7.1.1",
    "sweetalert": "^1.1.3",
    "underscore": "^1.8.3",
    "urijs": "^1.17.0",
    "vue": "~2.0.1",
    "vue-resource": "~1.0.1"
  }
}

I am on Laravel 5.4

It seems like a dependency is requiring a file/folder that does not exist. I tried temporarily removing all dependencies and no error. I tried leaving just the first dependency (bootstrap 3.0.0) and I get the same no such file or directory error.

Any ideas?

0 likes
8 replies
bobbybouwmann's avatar

It seems that the anti-styles dependency is missing! I don't know anything about your project and where this dependency comes from.

Try to remove the node_modules directory and run npm install again!

clat23's avatar

@BOBBYBOUWMANN -

After your reply, I did rm -rf node_modules && npm install and here are the results. Same ansi-styles dependency is missing:

npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: I wrote this module a very long time ago; you should use something else.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This module relies on Node.js's internals and will break at some point. Do not use it, and update to [email protected].
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm ERR! path /home/vagrant/Code/dsa/node_modules/ansi-styles/node_modules/color-name/package.json.2175372760
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/Code/dsa/node_modules/ansi-styles/node_modules/color-name/package.json.2175372760'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
clat23's avatar

I just tried npm install ansi-styles (https://www.npmjs.com/package/ansi-styles) and here is the result:

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm ERR! path /home/vagrant/Code/dsa/node_modules/ansi-styles/node_modules/color-convert/package.json.1465661898
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/Code/dsa/node_modules/ansi-styles/node_modules/color-convert/package.json.1465661898'
npm ERR! enoent This is related to npm not being able to find a file.
bobbybouwmann's avatar

This is in a vagrant box right? Do you run npm install in the vagrant box or outside the vagrant box?

clat23's avatar

@BOBBYBOUWMANN - Yes within Vagrant Box. I am using Laravel Homestead. I ran npm install after I have done vagrant ssh and switched to my project directory Code/dsa.

bobbybouwmann's avatar

Yeah that should be good. Sometimes if you run it outside the box and you run windows for example npm will install different libraries depending on the OS!

Anyway, you have to figure out where this package is used before continuing! I believe you can run npm ls ansi-styles for that!

bobbybouwmann's avatar

You should look if you can either upgrade gulp or remove it completely!

Please or to participate in this conversation.