Error: Cannot find module 'gulp-webserver' - node.js

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

Related

Error: Cannot find module 'graphql/validation/rules/PossibleTypeExtensions'

I am using the following book to build a MERN stack CRUD application. I'm having trouble installing and running graphql.
https://www.amazon.com/Pro-MERN-Stack-Development-Express-dp-1484243900/dp/1484243900/ref=mt_paperback?_encoding=UTF8&me=&qid= (published in 2019).
When I try to start the server contained in this repo https://github.com/vasansr/pro-mern-stack-2/tree/05.02-graphql-schema-file with the command npm start the app crashes and it returns an
Error: Cannot find module 'graphql/validation/rules/PossibleTypeExtensions'
I then followed some advice from a previous instance of this question on here to npm install karma-sinon-chai for the dependancies. But then I get the following error:
npm WARN apollo-graphql#0.4.4 requires a peer of graphql#^14.2.1 but none is installed. You must install peer dependencies yourself.
For me simply running npm install -g graphql fixed the problem (I had already installed Apollo globally with npm install -g apollo).
As per the error message apollo-graphql required a module from the graphql library validation/rules/PossibleTypeExtentions. The version of graphql I was using, as found by looking in my package.json, was "graphql":"^0.13.2".
I first tried to change this by changing my package.json to "^14.3.1". But after trying to install and run graphql I got the same error messages and when I looked in my package.json it had reverted back to "^0.13.2".
This may have been caused by my package.lock, locking me into that version. I then deleted package.lock, and node_modules folder.
I then ran the command nom install --save graphql#14.3.1, this worked fine.
I then just had to reinstall babel and Apollo-server-express and after this everything worked fine.

get error when trying to use twilio's npm package in meteor

I am trying to use the twilio node.js library with my meteor application. I was able to install the package using meteor npm install --save twilio
and it installed correctly. However, when I use import twilio from 'twilio'; I get this error
Error: Cannot find module 'crypto'(…)require # modules-runtime.js?hash=637cb12…:119meteorInstall.node_modules.twilio.lib.webhooks.js # modules.js?hash=9468cd4…:38774fileEvaluate # modules-runtime.js?hash=637cb12…:191require # modules-runtime.js?
Any thoughts on how to fix this. Seems to be a meteor error.
Normally, when you hit the command meteor npm install it should create a folder name meteor-node-stubs (/node_modules/meteor-node-stubs) in which the dependencies such as crypto etc. is arranged.
I think there is a problem with this folder in your project. My suggestion is to check whether you have this folder.
If you do not have it, you can try to install it by meteor npm install --save meteor-node-stubs That should solve your problem if this is the case

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.

Node can't find dependency after npm install

I am new to Node.js and hitting this problem on my DigitalOcean VPS, where my web app (Ghost) complains it can't find specific modules even after I install it:
root#3fen:/var/www/ghost# sudo npm install -g ghost-gql
ghost-gql#0.0.2 /usr/local/lib/node_modules/ghost-gql
└── lodash#3.10.1
root#3fen:/var/www/ghost# node index.js
ERROR: Ghost is unable to start due to missing dependencies:
Cannot find module 'ghost-gql'
Cannot find module 'jsonpath'
Please run `npm install --production` and try starting Ghost again.
Help and documentation can be found at http://support.ghost.org.
I confirmed that both entries exist in package.json's dependencies block, and I also tried npm install --production, it executes silently and still get the same error.
Please point me if I am missing anything in the above steps. Thank you!
it looks like global npm path is not set in the environment variable NODE_PATH.
which needs to be the path as in npm config get prefix concatenated with node_modules
In your case
export NODE_PATH=/usr/local/node_modules

Why after "npm install express" there is no package.json in my directory?

I am using latest version of nodejs, 0.10.24
I followed this tutorial: http://net.tutsplus.com/tutorials/javascript-ajax/how-to-scrape-web-pages-with-node-js-and-jquery/
after installing npm install express, I can't find the package.json file in the same directory.
But when I tried this on Windows a few months before, I noticed that there was a file in the same directory.
Is there anything I need to do to fix?
Thanks,
When you npm install module ,the only goal is to download and save the module in ./node_module/ directory.
If you want get a package.json, you must use npm init and fill all the information asked.
After that, you can make npm install module --save, that command will download and add the module in your package.json.

Resources