npm module Imager installation - node.js

I have been trying to install npm package because for some odd reason the module and GraphicsMagick library vanished into thin air from my machine(but that is a discussion for some other day).
Now I have installed the library but when I run
sudo npm install --save imager
I get a long list of errors. starting from
Error: ENOENT, lstat '/home/user/Desktop/project/node_modules/imager/node_modules/pkgcloud/node_modules/request/node_modules/json-stringify-safe/LICENSE'
any help would be appreciated.

Many npm modules are skins over previously written native code projects.
In this case : GraphicsMagick
If you first do the install of GraphicsMagick (outside of node/npm) or whichever is the underlying project. Get it up and running and only then do the npm install of its skin it will work. I just did these steps on ubuntu for npm module imager and the install worked fine.
Understand the meaning of npm install with a -g flag (global) - If the module makes available a command line executable then do npm install -g xxxx

Related

I can't install npm not matter what I do

So I'm trying to get myself a good Discord Selfbot and one of them requires nodejs, then it said to do npm install. But it gave me an error. I tried again again again and again but nothing worked. The latest thing I did was installing nodejs via scoop but I get this error trying to install npm. Is there a way to do this manually or something? I've tried installing different versions but nothing. I believe scoop installed the latest version.
Here's the image. (the red squares cover up just names)
You have npm already installed, seems that the problem is you don't have a package.json in that location. It says ENOENT: No such file or directory
You already have npm installed! npm is a package manager for installing nodejs packages. Try running some nonsense command (like "lkajshdflhsf") and you'll see what it looks like if you actually didn't have npm installed. What npm install does is install some package. So, for example, if you want to install a node package called Blah, you would run npm intall blah.

Fresh install of npm and node

I have recently started working with Angular 2 and am unable to get the Angular 2 Quickstart project to run correctly due to a number of errors in my npm dependencies.
Am I able to globally uninstall everything that was previously installed with npm to allow me to do a clean install of it and any required dependencies?
Note: The errors are the same as these examples which are caused by packages needing to be installed globally, however, the errors still occur having followed these steps...
To check your global installed packages you can type:
npm ls -g --depth=0
That lists all global installed packages with depth=0. That mean that it doesn't output dependencies of the packages. You can uninstall global packages with:
npm uninstall -g package-name
Please do not uninstall the npm package itself... But you can update your npm version with npm:
npm install npm -g
As mentioned in the Article your Node.js version should be at least v4.x.x and the npm version should be v3.x.x. You can get the installed versions with these commands:
node -v
npm -v
Updating your Node.js depends on your Operating System. Assuming that you use Windows you should uninstall the current version via control panel and download an actual release from the official Node.js page. https://nodejs.org/en/download/current/
To get a great overview how npm works you should consider reading their
documentation: https://docs.npmjs.com/
Make sure you have the correct node.js version. The guide says 5.0 or greater but points you to the wrong download link.
Try this: https://nodejs.org/en/download/current/
With this node you should be able to follow the guide step by step.

node.js install modules still loading without any result

I just want to install modules in folder on desktop
its still loading forever
in first time its work and install the modules but after thats its never install any modules
npm install express-generator -g
npm install .... I have package in same folder
its still like this see image
I uninstall it and install it again same problem also I uninstall it and download new 32 bit and same problem
i found the answer here
i just use this command
npm config set loglevel info
npm cache add xxx.tgz
http://www.eguidedog.net/doc/what-to-do-when-npm-install-hangs.php

Can't get Gulp to run: cannot find module 'gulp-util'

On Windows 7, I've installed gulp as explained here: http://markgoodyear.com/2014/01/getting-started-with-gulp/:
npm install gulp -g
In my app folder: npm install gulp --save-dev
I create a gulpfile.js file.
But then, when I try to run gulp, I get this error message:
module.js:340
throw err;
^
Error: cannot file module 'gulp-util'
at Function.Module._resolveFilename (module.js:338:15)
etc.
But gulp-util is present (in the local app folder) in:
node_modules
gulp
node_modules
gulp-util
Any idea what may be the cause?
UPDATE
From later versions, there is no need to manually install gulp-util.
Check the new getting started page.
If you still hit this problem try reinstalling your project's local packages:
rm -rf node_modules/
npm install
OUTDATED ANSWER
You also need to install gulp-util:
npm install gulp-util --save-dev
From gulp docs- getting started (3.5):
Install gulp and gulp-util in your project devDependencies
If you have a package.json, you can install all the current project dependencies using:
npm install
Any answer didn't help in my case.
What eventually helped was removing bower and gulp (I use both of them in my project):
npm remove -g bower
npm remove -g gulp
After that I installed them again:
npm install -g bower
npm install -g gulp
Now it works just fine.
Linux Ubuntu 18:04 user here.
I tried all the solutions on this board to date. Even though I read above in the accepted answer that "From later versions, there is no need to manually install gulp-util.", it was the thing that worked for me. (...maybe bc I'm on Ubuntu? I don't know. )
To recap, I kept getting the "cannot find module 'gulp-util'" error when just checking to see if gulp was installed by running:
gulp --version
...again, the 'gulp-util' error kept appearing...
So, I followed the npm install [package name] advice listed above, but ended up getting several other packages that needed to be installed as well. And one had a issue of already existing, and i wasn't sure how to replace it. ...I will put all the packages/install commands that I had to use here, just as reference in case someone else experiences this problem:
sudo npm install -g gulp-util
(then I got an error for 'pretty-hrtime' so I added that, and then the others as Error: Cannot find module ___ kept popping up after each gulp --version check. ...so I just kept installing each one.)
sudo npm install -g pretty-hrtime
sudo npm install -g chalk
sudo npm install -g semver --force
(without --force, on my system I got an error: "EEXIST: file already exists, symlink". --force is not recommended, but idk any other way. )
sudo npm install -g archy
sudo npm install -g liftoff
sudo npm install -g tildify
sudo npm install -g interpret
sudo npm install -g v8flags
sudo npm install -g minimist
And now gulp --version is finally showing:
CLI version 3.9.1
Local version 3.9.1
Try to install the missing module.
npm install 'module-name'
Same issue here and whatever I tried after searching around, did not work. Until I saw a remark somewhere about global or local installs. Looking in:
C:\Users\YourName\AppData\Roaming\npm\gulp
I indeed found an outdated version. So I reinstalled gulp with:
npm install gulp --global
That magically solved my problem.
You should install these as devDependencies:
- gulp-util
- gulp-load-plugins
Then, you can use them either this way:
var plugins = require('gulp-load-plugins')();
Use gulp-util as : plugins.util()
or this:
var util = require('gulp-util')
This will solve all gulp problem
sudo npm install gulp && sudo npm install --save del && sudo gulp build
None of the other answers listed here-- at least by themselves-- solved this for me.
I'm using Ubuntu 20.04 on Windows Linux Subsystem (WSL2). After reinstalling gulp globally with npm install gulp -g seemingly I needed to log out of my WSL instance and log back in again (closing and reopening my CLI was enough).
Hopefully this helps someone else.
I'm using Linux Mint 20.3. Had this error. Nothing helped.
gulp --version
node:internal/modules/cjs/loader:988
throw err;
^
Error: Cannot find module 'gulp-cli'
Found a solution after 2 hours of trying different things.
"sudo" ! simple as that.
sudo gulp --version
CLI version: 2.3.0
Local version: 3.9.1
Some gulp commands should be used with sudo to avoid errors
In most cases, deleting all the node packages and then installing them again, solve the problem.
But In my case, the node_modules folder has no write permission.
I had the same issue, although the module that it was downloading was different.
The only resolution to the problem is run the below command again:
npm install

How do we upgrade Lesscss to the most recent version in Windows using NPM?

I have recently upgraded my website from Bootstrap 2 to Bootstrap 3. In compiling the bootstrap.less, I am running into errors with the semi-colon separated parameters. The fix is apparently to upgrade to the most recent version of Lesscss. I have tried the following:
open a node.js command prompt and run the following
npm install less
This doesn't do the trick. What needs to be done to properly update lesscss?
Try to use this code:
npm update less
npm update -g less
If you just want to upgrade, use Slawa Eremkin's answer.
If you really want to see what's going on, open a node.js command prompt and run the following:
// list installed modules
npm list
npm list -g
// uninstall less
npm uninstall less
npm uninstall -g less
// test
npm list
npm list -g
// install
npm install less
npm install -g less
// test again
npm list
npm list -g
Done. Note: the -g flag is for globally install modules. I decided to uninstall and re-install both globally and otherwise, although I am not sure that this is required.

Resources