npm - gulp-sass no longer has a default Sass compiler; please set one yourself - npm

Keep getting this error when trying to build templates
[09:21:08] Requiring external module babel-register
[09:21:19] Using gulpfile ~/GIT/Newsletters/gulpfile.babel.js
[09:21:19] Starting 'build'...
[09:21:19] Starting 'clean'...
[09:21:19] Finished 'clean' after 5.98 ms
[09:21:19] Starting 'pages'...
[09:21:20] Finished 'pages' after 1.96 s
[09:21:20] Starting 'sass'...
Error in plugin "gulp-sass"
Message:
gulp-sass no longer has a default Sass compiler; please set one yourself.
Both the "sass" and "node-sass" packages are permitted.
For example, in your gulpfile:
const sass = require('gulp-sass')(require('sass'));
When I then add const sass = require('gulp-sass')(require('sass')); in my gulpfile.js
It gives this error
[09:41:01] Requiring external module babel-register
{ TypeError: /Users/lde4k1v/GIT/Newsletters/gulpfile.babel.js: Duplicate declaration "sass"
76 |
77 | // Compile Sass into CSS
> 78 | function sass() {
| ^
79 | return gulp.src('src/assets/scss/app.scss')
80 | .pipe($.if(!PRODUCTION, $.sourcemaps.init()))
81 | .pipe($.sass({
Here is my full gulpfile.babel.js
Can someone help me out :( already searched quite some time on it and can't find seem to fix it sadly

Related

After make an npm update the console shows Error: Module not found: Error: Can't resolve 'angular2-moment'

I was trying to install jquery on my Angular project and after write some jquery dependency on package.json doc and type npm update, the console says Error: Module not found: Error: Can't resolve 'angular2-moment'.
Error occurs in the template of component RegisterComponent.
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
× Failed to compile.
✔ Browser application bundle generation complete.
Initial Chunk Files | Names | Raw Size
main.js | main | 83.62 kB |
runtime.js | runtime | 6.51 kB |
4 unchanged chunks
Build at: 2023-01-10T02:39:00.432Z - Hash: 2a1b1b37176d6913 - Time: 536ms
./src/app/app.module.ts:7:0-47 - Error: Module not found: Error: Can't resolve 'angular2-moment' in 'C:\Users\xxxxxx\Desktop\Proyectos IT\registro_cintas\client\src\app'
Error: src/app/app.component.html:6:34 - error NG8002: Can't bind to 'routerLink' since it isn't a known property of 'a'.
6 <a class="link-home" [routerLink]="['/home']">
continue...
~~~~~~~~~~~~~~~~~~~~~~~~
I tryed installing ngx-moment, angular2-moment again or uninstalling this last one algo I erase the entire folder and made a git clone from the last working commit but nothing, I think the angular2-moment it's not compatible with my Angular version but I don't know what to do.

"Module build failed..." in Laravel Mix

I did not change anything in app.scss, but when I run npm run watch I get the following errors:
error in ./resources/sass/app.scss
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Unsupported operation: Cannot extract a file path from a URI with a fragment component
# ./resources/sass/app.scss 2:14-254
Asset Size Chunks Chunk Names
/js/app.js 2.46 MiB /js/app [emitted] /js/app
ERROR in ./resources/sass/app.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):
undefined
^
Join(null, "variables"): part 0 was null, but part 1 was not.
#import 'variables';
^^^^^^^^^^^
stdin 2:9 root stylesheet
in C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\resources\sass\app.scss (line 2, column 9)
at runLoaders (C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\webpack\lib\NormalModule.js:30
at C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\loader-runner\lib\LoaderRunner.js:364:11
at C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\loader-runner\lib\LoaderRunner.js:230:18
at context.callback (C:\Users\TAQI VAHEED\Desktop\#Coding\resPro\node_modules\loader-runner\lib\Loader
13)
Any help appreciated.
Finally found the issue. It is related to dart-sass being used instead of node-sass with laravel-mix v4.x.x.
Turns out something related to dart-sass or laravel-mix does not work well with paths containing a '#' symbol. In your case, your app is located at C:\Users\TAQI VAHEED\Desktop\#Coding\resPro and the #Coding folder is creating the error.
Either move your app somewhere else without a '#' symbol in the path OR enable node-sass again by following the steps from laravel-mix 4.0.0 release notes:
you can manually switch back to node-sass, like so:
npm install node-sass
mix.sass('resources/sass/app.sass', 'public/css', {
implementation: require('node-sass')
});
in your webpack.mix.js write the code
mix.js('resources/js/app.js', 'public/js')
.postCss('resources/css/app.css', 'public/css');

Error when run gulp start

I'm searching and searching and I can´t find the error.
Now I hope someone help me.
npm -v
[18:54:13] Requiring external module babel-core/register
[18:54:13] CLI version 3.9.0
[18:54:13] Local version 3.9.0
gulp -v
5.6.0
$ gulp start
[18:47:59] Requiring external module babel-core/register
/node_modules/babel-core/lib/transformation/file/index.js:558
throw err;
^
SyntaxError: /config/index.js: Unexpected token (31:17)
29 | const bothConfig = require('./both');
30 |
> 31 | export default { ...bothConfig, ...envConfig };
| ^
32 |
at Parser.pp$5.raise (/node_modules/babylon/lib/index.js:4454:13)
at Parser.pp.unexpected (/node_modules/babylon/lib/index.js:1761:8)
at Parser.pp$3.parseIdentifier (/node_modules/babylon/lib/index.js:4332:10)
at Parser.pp$3.parsePropertyName (/node_modules/babylon/lib/index.js:4156:96)
at Parser.parsePropertyName (/node_modules/babylon/lib/index.js:6229:23)
at Parser.pp$3.parseObj (/node_modules/babylon/lib/index.js:4045:12)
at Parser.pp$3.parseExprAtom (/node_modules/babylon/lib/index.js:3719:19)
at Parser.parseExprAtom (/node_modules/babylon/lib/index.js:7238:22)
at Parser.pp$3.parseExprSubscripts (/node_modules/babylon/lib/index.js:3494:19)
at Parser.pp$3.parseMaybeUnary (/node_modules/babylon/lib/index.js:3474:19)
export default{bothConfig, envConfig};

Errors after installing '#babel/preset-env'

when I was trying to start my npm project I got the following error:
/home/projects/reactive-weather/reactive-weather/app/node_modules/expo/src/Location.js:
Cannot find module '#babel/preset-env' from '/home/projects/reactive-weather/reactive-weather/app'
Surely I need to install this module but after I did, I'm getting this error:
Error: /home/projects/reactive-weather/reactive-weather/app/node_modules/expo/src/Location.js: Unexpected token, expected ";" (9:5)
7 | const LocationEventEmitter = new NativeEventEmitter(NativeModules.ExponentLocation);
8 |
> 9 | type ProviderStatus = {
| ^
10 | locationServicesEnabled: boolean,
11 | gpsAvailable: ?boolean,
12 | networkAvailable: ?boolean,
10:43:44 AM: Failed building JavaScript bundle
Everything was perfectly fine, the last thing I've done before this happened was using git commands like: git stash also I had to perform npm audit fix but I don't think any libs were vulnerable.

Cannot generate new project using yeoman generator Gradle+Kotlin

I installed Android Studio on Mac using brew install Caskroom/cask/android-studio
Then, I run yo gradle-kotlin, and got the following error. What can I do to make my first Hello World work?
Thank you
✔ /Volumes/Git/android/kotlin-hello-world
10:53 $ yo gradle-kotlin
_-----_
| | .--------------------------.
|--(o)--| | Welcome to the |
`---------´ | incredible Gradle+Kotlin |
( _´U`_ ) | generator! |
/___A___\ '--------------------------'
| ~ |
__'.___.'__
´ ` |° ´ Y `
Detecting installed Gradle version...
Fetching latest Kotlin version from Maven Central...
✔ Fetched latest Kotlin version: 1.0.1-2
✔ Detected installed Gradle version: 2.12
? What's your project name? kotlin hello world
? What Gradle version would you like to use? 2.12
? What Kotlin version would you like to use? 1.0.1-2
? Do you want to use Kotlin Reflection? Yes
? Would you like to use IDEA Gradle plugin? Yes
identical .gitignore
identical src/main/kotlin/.gitkeep
identical src/test/kotlin/.gitkeep
identical build.gradle
identical gradle.properties
identical settings.gradle
Executing 'gradle wrapper' command...
✔ Done executing 'gradle wrapper' command.
Executing Gradle tasks: idea build
internal/child_process.js:298
throw errnoException(err, 'spawn');
^
Error: spawn EACCES
at exports._errnoException (util.js:856:11)
at ChildProcess.spawn (internal/child_process.js:298:11)
at Object.exports.spawn (child_process.js:362:9)
at Function.spawn (/usr/local/lib/node_modules/generator-gradle-kotlin/node_modules/cross-spawn-async/index.js:13:18)
at spawn (/usr/local/lib/node_modules/generator-gradle-kotlin/node_modules/cross-spawn/index.js:34:23)
at GradleKotlinGenerator.spawnCommand (/usr/local/lib/node_modules/generator-gradle-kotlin/node_modules/yeoman-generator/lib/actions/spawn_command.js:20:10)
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/generator-gradle-kotlin/generators/app/gradle-kotlin.coffee:78:8)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
I've just fixed it.
It was an OSX-specific bug in the generator logic, a rather stupid one: it incorrectly detected the platform and tried to call ./gradlew.bat, it didn't even realize it's a .bat file, the reason for EACCES error actually was that this .bat didn't have +x permission. Just update the generator to 1.1.1 and it should be fine.