I've got some issues with trying to run gulp with Ionic.
The error message that pops up is this:
Error: Cannot find module 'gulp-util'
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. (/Users/emilymacleod/Desktop/myApp/gulpfile.js:2:13)
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 tried installing sass and gulp locally in the myApp folder as well as globally and no dice.
Thoughts?
Kind of a long shot, but gulp-util is a separated module. You should install it locally:
npm install gulp gulp-util --save-dev
and require it in your code:
var gutil = require('gulp-util');
I'm having the problem of cannot find gulp-util even after doing the procedure at the end of this. I can see it's added to the modules and the package.json, but that require statement seems to have an error. It doesn't seem to be working.
The PROCEDURE
npm install gulp gulp-util --save-dev
and require it in your code:
var gutil = require('gulp-util');
I had similar issue with gulp-sass. Error message was:
Uh oh! Looks like you're missing a module in your gulpfile:
Cannot find module 'gulp-sass'
Do you need to run npm install?
Resolved by executing the following:
npm -g install npm
npm install gulp-sass
Hope this help.
Related
I've been following Tailwind's tutorials and when. I get to the part of the tutorial where they ask me to run npx tailwindcss-cli build css/tailwind.css -o build/tailwind.css, I get the following error. How do I solve this?
(node:5568) ExperimentalWarning: The fs.promises API is experimental
/Users/USERNAME-REDACTED/.npm/_npx/8bcfa250e55e6bf5/node_modules/tailwindcss/lib/jit/corePlugins.js:242
...Object.fromEntries(Object.entries(corePlugins).map(([pluginName, plugin]) => {
^
TypeError: Object.fromEntries is not a function
at Object.<anonymous> (/Users/USERNAME-REDACTED/.npm/_npx/8bcfa250e55e6bf5/node_modules/tailwindcss/lib/jit/corePlugins.js:242:13)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/Users/USERNAME-REDACTED/.npm/_npx/8bcfa250e55e6bf5/node_modules/tailwindcss/lib/jit/lib/setupContextUtils.js:36:43)
at Module._compile (internal/modules/cjs/loader.js:778:30)
I've tried deleting npm, updating npm, removing my package-lock and node modules and restarting, and adding -i. all to no prevail. As is made apparent from the youtube series I linked, I'm just learning tailwind, so I'm sure it's a super stupid mistake.
The issue originated from your node version.
Please try this:
sudo npm i -g n
Than inside your project folder
n latest
after that close your current terminal, since it will remember the old node location, open a new one and it should be fixed.
If you don't want the overhead of nvm then you can just download a binary release of nodejs, eg:
mkdir -p ~/opt/src
cd ~/opt/src
wget https://nodejs.org/download/release/v14.17.0/node-v14.17.0-linux-x64.tar.xz
cd ~/opt tar xf src/node-v14.17.0-linux-x64.tar.xz --strip 1
To use it interactively first run:
export PATH=$HOME/opt/bin:$PATH
Source:https://community.opalstack.com/d/636-install-node-and-npm-without-having-to-sudo
I'm working on a course project using gulp. Gulp has been working fine for weeks, but today I sat down at my computer to continue the course and am getting an error when I try and start my gulp watch task. Again, this has been working fine for weeks prior to today.
When I attempt to run gulp watch I get the following error:
module.js:471
throw err;
^
Error: Cannot find module 'lodash._basevalues'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/rockypruitt/Google Drive/Web Design and
Development/Learning to Code/Udemy-Git a web developer job - Brad
Schiff/Sites/travel-site/node_modules/lodash.template/index.js:11:18)
at Module._compile (module.js:570:32)
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)
Any assistance will be appreciated.
Rocky you should try with Remove node_modules folder and run npm install again.
I get an error while installing React-native, I have tried to search for an answer, but I can not find one.
When running "react-native init meet" I get this error:
This will walk you through creating a new React Native project in /Users/alfred/React/meet
Installing react-native package from npm...
Setting up new React Native app in /Users/alfred/React/meet
module.js:338
throw err;
^
Error: Cannot find module './src/init'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/alfred/React/meet/node_modules/react-native/node_modules/yeoman-generator/node_modules/download/node_modules/vinyl-fs/node_modules/gulp-sourcemaps/index.js:4:9)
at Module._compile (module.js:434:26)
at Module._extensions..js (module.js:452:10)
at Object.require.extensions.(anonymous function) [as .js] (/Users/alfred/React/meet/node_modules/react-native/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
I don't really get what is wrong...
It's related to an issue with gulp-sourcemaps recent deployment https://github.com/floridoo/gulp-sourcemaps/issues/238
A project maintainer says at the end of the thread that he'll get to it today and
For the time being lock your version down to 2.0.x or 1.7.x
To fix, add specific version in your package.json until the issue is fixed:
{
"devDependencies": {
"gulp-sourcemaps": "1.7.x"
}
}
Use npm shrinkwrap to prevent similar issues in the future.
This is caused by a recent change in gulp-sourcemaps. See bug here: https://github.com/floridoo/gulp-sourcemaps/issues/238
This is now fixed. Run npm install
https://github.com/floridoo/gulp-sourcemaps/issues/238
I've been following the laravel's api token-based authentication using passport. I followed all the steps in this screen cast by Taylor Otwell himself. To publish the passport Vue components, I ran the command:
php artisan vendor:publish --tag=passport-components
and the components where rightly published in the resources/assets/js/components directory.
Next,I registered the some components in resources/assets/js/app.js file and here's the result:
require('./bootstrap');
Vue.component('example', require('./components/Example.vue'));
Vue.component(
'passport-clients',
require('./components/passport/Clients.vue')
);
Vue.component(
'passport-authorized-clients',
require('./components/passport/AuthorizedClients.vue')
);
Vue.component(
'passport-personal-access-tokens',
require('./components/passport/PersonalAccessTokens.vue')
);
const app = new Vue({
el: '#app'
});
I ran the command gulp but gulp wasn't recognized so I installed with the following two commands:
npm install --global gulp-cli
npm install --save-dev gulp
Here is my gulpfile.js file by the way (at the root of my project):
const elixir = require('laravel-elixir');
require('laravel-elixir-vue-2');
var gulp = require('gulp');
elixir(function(mix){
mix.sass('app.scss')
.webpack('app.js');
});
next a pasted the following components in the home.blade.php view file after logging in:
<passport-clients></passport-clients>
<passport-authorized-clients></passport-authorized-clients>
<passport-personal-access-tokens></passport-personal-access-tokens>
I now ran the command gulp in the root of my application and got the following error:
> Error: Cannot find module 'laravel-elixir'
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> (/home/awa/Desktop/laravel53/gulpfile.js:1:78)
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 may be making some silly mistaker here but I just can't get my way out of it. I am new to Laravel. I'll appreciate any help.
Thanks
It looks like you don't have Laravel Elixir installed. It is is not automatically installed with laravel, you need to run:
npm install
from the root of your project, which will download laravel elixir and all it's dependencies.
I´m in my project folder on my terminal, and:
if I extecute:
gulp -v
I get:
[15:47:15] CLI version 3.9.0
[15:47:15] Local version 3.9.0
if I excute:
gulp watch
I get:
Error: Cannot find module 'gulp-uglifyjs'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/Applications/XAMPP/xamppfiles/htdocs/last/gulpfile.js:3:14)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
Then, I search in the gulpfile.js 3:14 and I see this:
var uglify = require('gulp-uglifyjs');
I was read about this, a lot people say "oh, do npm install", I do, and after make npm -v I get this:
3.3.12
I was trying with a lot commands, but I dont know what happen. Maybe gulpfile.js?
Maybe I forgot a dependencie?
Maybe I forgot a dependencie?
Yes maybe local installation will resolve you problem. Run next command in you project:
npm install --save-dev gulp-uglify
Try to replace
require('gulp-uglifyjs');
with
require('gulp-uglify');
see also https://www.npmjs.com/package/gulp-uglify