Gulp doesn't work - gulp

I installed gulp on my machine, but when i try to compile my project i have this error:
Error: Cannot find module 'del'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Applications/MAMP/htdocs/project/gulpfile.js:6:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
I dont understand the error and i dont know how solve.
Someone can help me?
Thanks

This error message indicates that the module 'del' cannot be found. It seems that the 'del' package is not installed or not properly configured in your project.
Try installing the 'del' package by running the following command in your terminal:
npm install del --save-dev
If you have already installed 'del' package and still getting this error, try uninstalling and then reinstalling it.
npm uninstall del
npm install del --save-dev
Also make sure that you have the latest version of npm and node installed on your machine.
npm install -g npm
After installing or reinstalling 'del' package, you can try running the gulp command again and see if the error persists.

Related

Error while compiling css and js files using gulp

I am getting the below mentioned error and I am not able to figure out how to handle it. Versions of gulp, node and npm are mentioned below. I don't know if it is node's version mismatch with that of gulp or something else but so far any help would be much appreciated.
gulp -v
CLI Version: 2.3.0
Local Version: 3.9.1
node -v
v6.10.3
npm -v
3.10.10
ERROR
C:\xampp\htdocs\ecommerce\node_modules\engine.io\build\server.js:173
async handshake(transportName, req, closeConnection) {
^^^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\xampp\htdocs\ecommerce\node_modules\engine.io\build\engine.io.js:5:18)
Support for async functions was added in Node 7.6.0.
You are using Node 6.10.3.
You need to upgrade.
The oldest version of Node which is still supported (although only for a matter of weeks!) is version 12.
Upgrade to at least version 16.14.2 (the current long term support release).
install version 8.11.1 and run :
npm install
npm install gulp bower --global
npm install node-sass#latest
npm uninstall laravel-elixir
npm uninstall session
npm install --save laravel-elixir
npm install --save session
gulp
after that it will work

Global NPM command missing module: Contentful sync fails

I've globally installed an NPM module like so:
sudo npm install -g contentful-space-sync
The install flags a warning, but not sure if this is an issue:
npm WARN peerDependencies The peer dependency stream-browserify#* included from bl will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
contentful-space-sync#3.0.0 node_modules/contentful-space-sync
├── bluebird#3.1.1
├── yargs#3.31.0 (camelcase#2.0.1, window-size#0.1.4, y18n#3.2.0, decamelize#1.1.2, string-width#1.0.1, os-locale#1.4.0, cliui#3.1.0)
├── npmlog#2.0.0 (ansi#0.3.1, gauge#1.2.4, are-we-there-yet#1.0.5)
├── contentful-batch-libs#2.0.0 (contentful-management#0.7.1, contentful#1.2.1)
└── lodash#3.10.1
Install seems to work. To run the module, it's easiest to create a config file for it, which I did:
{
"sourceSpace": "xxxxxxxx",
"destinationSpace": "xxxxxxxx",
"sourceDeliveryToken": "xxxxxxxx",
"managementToken": "xxxxxxxx"
}
Now I run the module like this:
contentful-space-sync --config config.json
But I get the following error:
module.js:339
throw err;
^
Error: Cannot find module 'babel-register'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/usr/local/lib/node_modules/contentful-space-sync/index.js:5:5)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/usr/local/lib/node_modules/contentful-space-sync/bin/space-sync:4:20)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
I've never had something like this for a globally installed module. Why can't it find a module it needs and how do I fix this?
this was a bad release. We're aware of the issue and working on a fix.
For now the best thing is to use 2.1.9. You can install it with npm install -g contentful-space-sync#2.1.9

Cannot find module executing gulp for laravel windows

I am following this laracasts video. Here is my
package.json:
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"laravel-elixir": "^2.0.0",
"bootstrap-sass": "^3.0.0"
}
}
I installed gulp using
npm install gulp
Then I executed:
npm install in the project root directory for installing the dependencies in package.json
Now when I execute gulp, I get this error:
module.js:339
throw err;
^
Error: Cannot find module 'lodash/lang/isFunction'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (D:\PhpIdeaProjects\LaravelLearning\myproject-flyer\no
de_modules\laravel-elixir\node_modules\babelify\node_modules\babel-core\lib\api\
node.js:21:29)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
Then after some research, I execute npm install theMissingModuleName (Here theMissingModuleName is lodash/lang/isFunction) which runs successfully. But again when I run gulp, I get another missind module error(For different module). I install that then it gives another.....
This cycle continues.
I have already installed gulp locally using npm install gulp -g and placed C:\Users\rahul\AppData\Roaming\npm directory in path.
So now what should I do to avoid these recursive errors?
Make sure you have updated npm to the latest version:
npm install npm#latest -g
Then check you have version 3.x.x installed:
npm -v
As of 3.0.0 npm has a flat directory structure so you shouldn't run in to max character limit issue.
After you have updated, just delete your node_modules and do:
npm install
in the root of your project.

Error When Executing Gulp on Mac OS X

Having trouble running Gulp, and not quite sure what the issue is here. I've Googled the error, yet all forums that have come up haven't fixed my issue.
Here's the relevant install info:
npm -v
2.11.3
node -v
v0.12.7
node -p process.versions
{ http_parser: '2.3',
node: '0.12.7',
v8: '3.28.71.19',
uv: '1.6.1',
zlib: '1.2.8',
modules: '14',
openssl: '1.0.1p' }
node -p process.platform
darwin
node -p process.arch
x64
And the error I'm getting when executing Gulp:
Error: `libsass` bindings not found in /PATH/TO/node_modules/gulp-sass/node_modules/node-sass/vendor/darwin-x64-14/binding.node. Try reinstalling `node-sass`?
at Object.sass.getBinaryPath (/PATH/TO/node_modules/gulp-sass/node_modules/node-sass/lib/extensions.js:148:11)
at Object.<anonymous> (/PATH/TO/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:16:36)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/PATH/TO/node_modules/gulp-sass/index.js:163:21)
at Module._compile (module.js:460:26)
Kind of lost on what to do next...
Try running npm rebuild node-sass after npm install node-sass.

Error: Cannot find module 'mysql'

in windows server 2008 i use nodejs to run my js file so to run my js need to have mysql so i installed mysql with command: npm install mysql
after installation there is this log:
C:\Users\lol>npm install mysql
npm http GET https://registry.npmjs.org/mysql
npm http 304 https://registry.npmjs.org/mysql
npm http GET https://registry.npmjs.org/bignumber.js/1.0.1
npm http GET https://registry.npmjs.org/require-all/0.0.3
npm http 304 https://registry.npmjs.org/require-all/0.0.3
npm http 304 https://registry.npmjs.org/bignumber.js/1.0.1
mysql#2.0.0-alpha9 node_modules\mysql
├── require-all#0.0.3
└── bignumber.js#1.0.1
But evry time i want to run my js i have this error:
C:\Users\lol>node D:\node\npauthapi.js
module.js:340
throw err;
^
Error: Cannot find module 'mysql'
at Function.Module._resolveFilename (module.js:338:15
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (D:\node\npauthapi.js:1:75)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
You can do a global install to avoid this problem:
npm install -g mysql
you installed it locally in folder c:\users\lol, so it's not available in your folder d:\node
Place your .js file in the same location where you ran the command (npm install mysql). This is because after the installation, the MySQL node_modules folder will be created in that location so you should place the .js file there so that while running, it can get the required modules from the node_modules folder.