Missing packages after cleaning node_modules - css

I had an issue: npm run watch was stuck after 10%, so I deleted node_modules directory and package-lock.json
But I guess I installed modules with npm install without using --save-dev, and after having reinstalled several of them I still get a warning and can't identify which package is missing here...
WARNING in ./resources/js/components/common/ContenuComponent.vue?vue&type=style&index=0&id=1a3ffd6c&scoped=true&lang=css& (./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/laravel-mix/node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/common/ContenuComponent.vue?vue&type=style&index=0&id=1a3ffd6c&scoped=true&lang=css&)
Module Warning (from ./node_modules/css-loader/dist/cjs.js):
Warning
(476:2) Unable to find uri in 'background:url() no-repeat top left black'
# ./resources/js/components/common/ContenuComponent.vue?vue&type=style&index=0&id=1a3ffd6c&scoped=true&lang=css& (./node_modules/style-loader!./node_modules/css-loader/dist/cjs.js??ref--6-1!./node_modules/laravel-mix/node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/common/ContenuComponent.vue?vue&type=style&index=0&id=1a3ffd6c&scoped=true&lang=css&) 2:14-388
# ./resources/js/components/common/ContenuComponent.vue?vue&type=style&index=0&id=1a3ffd6c&scoped=true&lang=css&
# ./resources/js/components/common/ContenuComponent.vue
# ./resources/js/app.js
# multi ./resources/js/app.js ./resources/sass/app.scss
I did:
npm install postcss-loader --save-dev
npm install style-loader --save-dev
npm install css-loader --save-dev
npm install file-loader --save-dev
npm install vue-loader --save-dev
Is there any way to identify what I am missing?
Thanks a lot!

when you remove package-lock.json, you remove references about which specific versions of each package were installed before. My guess is that there was an issue published within the css-loader module, which seems to be a dependency of a dependency of Laravel.
The easiest fix would be bringing back package-lock.json, removing node_modules again and reinstalling with npm install.

There are few things you can try based on the information you have provided. You can try npm cache clean or npm cache clean --f (this is a force, which will ask you if you know what you are doing, you can proceed with the force). Once the cache has been cleaned, you can try running npm install again. Also check your version of NodeJS and make sure that whatever packages you're using is also supporting the version. Node -V and check and make sure that css loader supports your version of node.

After I thought it had been fixed, I got the issue again today (worst actually, this time it was an error). So I went back to package-lock.json old version and after many tries and another hours lost, it worked.
I guess this is gonna happen again and obviously I cannot do that because I will add other packages in the future. I am wondering if there is any way to add all missing packages in package.json dev dependencies? I have no idea how to identify them?
It seems like npm install ls node_modules --save was working some years ago, so I m trying to dind something like this but reading in package-lock.json maybe (am I dreaming? :) )
Thanks a lot

Related

How can I run npm install succesfully

I have a problem from upload my VueJs#2/firebase project.
My last work version is at 11/2021.
But all version of components need to be update.
So npm install don't success to install and update all.
I need your help to say me what should I do to work again on this project.
I joined a complete log of run npm install and my package.json.
Please help me.
npm outdated will identify packages that should be updated.

Downgrade Firebase 9.6 to 9.2.0

What commands must I follow on the command line to downgrade. I ran uninstall and reinstalled as well as nom i -S firebase#... but now when I reload the app it just crashes.
If you have to install an older version of a package, just specify it
npm install <package>#<version>
For example: npm install firebase#9.2.0
You can also add the --save flag to that command to add it to your package.json dependencies, or --save --save-exact flags if you want that exact version specified in your package.json dependencies.
The install command is documented here: https://docs.npmjs.com/cli/install
If you're not sure what versions of a package are available, you can use:
npm view firebase versions
And npm view can be used for viewing other things about a package too.
https://docs.npmjs.com/cli/view
don't forget to remove .lock file first to rebuilt the depedency
can u give the error messege for us....

jit-grunt: Plugin for the “clean” task not found

After running grunt clean in magento 2.1.3 root folder I get error
If you have installed the plugin already, please setting the static mapping.
See https://github.com/shootaroo/jit-grunt#static-mappings
Warning: Task "clean" failed. Use --force to continue.
Aborted due to warnings.
I tried npm install clean & npm install clean --save-dev but get the same error.
I looked at the url for static mapping, but it is not clear in the Magento environment what I should add where?
How do I solve this error?
Try this:
npm install grunt-clean --save-dev
or
npm install grunt-contrib-clean --save-dev
Please refer to Gruntfile.js

Unable to install grunt on windows 8

Been trying to install Grunt on my laptop to try it out, I already had Node, so installed the Grunt cli which went ok and then ran the command npm init to create the package.json file, followed the necessary steps and also went well, however when I get to the point of installing dependencies, I get an error.
For instance am trying to install Grunt as a dependency, with the following command:
npm install grunt --save-dev
After running this command I get the following error:
No README.md file found
If anyone knows what I am meant to do please let me know.

Error with grunt (grunt-contrib)

If I want to install a package via npm globally, then I get the following error repeatedly... Has anybody an idea to solve this problem?
The short answer is don't install grunt-contrib. It used to be a small collection of tasks but as the grunt-contrib-* series grew, so did that library.
Nobody ever needs to install every grunt-contrib-* library. Instead, just install the tasks you need: npm install grunt-contrib-compress --save-dev
Otherwise, if you insist, install the peer dependency version it expects npm install grunt-contrib-compress#0.6.1 and try installing again: npm install grunt-contrib.

Resources