Error: Cannot find module 'pretty-bytes' - node.js

I am getting Error: Cannot find module 'pretty-bytes' error on my mac machine when I do yo gulp-angular.
Not able to run gulp serve after getting this error

When you have a Error: Cannot find module it means that you're trying to require a package that is not installed yet.
Open a terminal then cd in your project root. When you're in your projet root you can install the module by executing npm install pretty-bytes.
You should also consider adding it to your package.json file either in the dependencies or the devDependencies.

Related

Cannot find module 'express' while running nodemon. Throw error, app crashed

I just created a project "project2" using "create new project : express --view=ejs project2" on a directory where I'd previously installed nodemon.
But when I typed "nodemon" on the terminal, the error says:
I installed http-errors too, but the error message persists.
What should I do to resolve this?
Try running npm install inside the project
It worked after I installed express inside project2 using:
npm install express --save
However, there were still more error messages such as:
"Could not find module 'cookie-parser'," which were all resolved by installing all the respective modules.

Error: Cannot find module 'gulp-webserver'

When I running the node.js project with gulp. I'm getting "Error: Cannot find module 'gulp-webserver'". Re-wrote the connection with below but still its same.
$ npm install --save-dev gulp-webserver
Issue was with the existance of the web server.
Solution: Go to gulp location within your solution and use below..Solved!
$ npm install --save-dev gulp-webserver
This would be usefull..enter link description here

can't install module 'merge-descriptors'

I'm new to node.js.
I'm using WebStorm. I work on Windows.
I configured my app to run on node.js and when I try to run it I get this error:"Cannot find module 'merge-descriptors'".
I followed these post trying to solve it: How do I resolve "Cannot find module" error using Node.js?,
module.js:338 throw err in node.js
I ran "del /s /q node_modules" (parallel to "rm -rf node_modules").
Now I'm trying to run "npm install -g" and I'm getting this error:
See screen shot below
I've tried to understand it and to look for information about it in the net to no avail.
Any help will be profoundly appreciated!
I had similar issue installing the module, I tried npm install or npm update but my network would timeout. However what I did is very simple:
npm install merge-descriptors --save
When installing the dependencies for a package you should be using npm install and not using the -g flag.
The g flag, or global is used when installing a package globally, which places them in a direct location that is not accessible by the project.
See https://docs.npmjs.com/files/folders
The specific error you're seeing is that the logged in user doesn't have permission to write to the install directory. This can be overcome with sudo command, ex., sudo npm install. But as others have indicated, if you have to do this then something about your app's configuration could be wrong.

Error: cannot find module npm-shrinkwrap

Setting up bootstrap with grunt.
Getting the following error:
Cannot find module npm-shrinkwrap
Tried npm install shrinkwrap, still getting the same error.
run npm install first on bower_components\bootstrap directory. Then, run grunt dist.

Node unable to load native module 'profiler.node'

I'm trying use the library another-v8-profiler , but when I try execute the server, the message is displayed:
unable to load native module 'profiler.node' from ./build/Release/profiler or ./compiled/win32/x64/v
0.10.12/profiler
Some has an idea?
If you did npm install another-v8-profiler, did you see any errors or any compilation output? You could try npm install node-gyp -g and then changing to the module's root directory and do node-gyp rebuild. If successful, go back to your project's directory and try starting the server again.

Resources