Answer the question
In order to leave comments, you need to log in
What to put in package.json when installing npm packages globally?
Installed npm package grunt-contrib-cssmin --save-dev -g , installed it in
C:\Users\Daniel\AppData\Roaming\npm\node_modules\grunt-contrib-cssmin
But nothing changed in package.json in devDepencies , as there was no dependency, it did not exist)) and, accordingly, the grunt call did not give anything, only the question "Is the package installed?" .
So you need to write in the console to call grunt
Answer the question
In order to leave comments, you need to log in
So you installed it globally ( -g
), it did not register in package.json. It should be like this:
And for grunt to work, you need to install two packages:
npm install grunt-cli -g # обратите внимание, этот пакет ставится глобально и добавляет в систему команду grunt
npm install grunt --save-dev # этот ставится локально и собственно выполняет работу
Konstantin, if I write in the console, I
will install the package locally, but I don’t need it, because the idea is to install the package once and use it in different projects . Or can't it be done?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question