Why am I getting gulp-changed error? - react-native

My gulpfile is below -
'use strict';
//dependencies
var gulp = require('gulp');
var sass = require('gulp-sass');
var minifyCss = require('gulp-clean-css');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var changed = requrie('gulp-changed');
Error after runnning gulp.
Error is for var changed = requrie('gulp-changed'); -
ReferenceError: requrie is not defined
at Object.<anonymous> (/home/lap1/Desktop/ReactJS/react-
test/gulpfile.js:9:15)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at execute (/usr/lib/node_modules/gulp-
cli/lib/versioned/^3.7.0/index.js:28:18)
at Liftoff.handleArguments (/usr/lib/node_modules/gulp-
cli/index.js:175:63)
Gulp version - 3.9.1
React native version - 2.0.1
I have installed all the dependencies both globally and for the project alone.

there iss a spelling mistake
Replace this
var changed = requrie('gulp-changed');
by
var changed = require('gulp-changed');

Related

How to compiler code in solidity version 0.8.17 using npm?

Trying to compiler code in solidity using npm but getting an error like this
node:assert:400
throw err;
^
AssertionError [ERR_ASSERTION]: Invalid callback object specified.
at runWithCallbacks (D:\BlockChainProjects\inbox\node_modules\solc\wrapper.js:117:34)
at compileStandard (D:\BlockChainProjects\inbox\node_modules\solc\wrapper.js:223:20)
at Object.compileStandardWrapper [as compile] (D:\BlockChainProjects\inbox\node_modules\solc\wrapper.js:229:20)
at Object. (D:\BlockChainProjects\inbox\compiler.js:9:18)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
This was my code that I wrote in compiler.js
const path = require('path')
const fs = require('fs')
//getting solidity compiler
const solc = require('solc')
const inboxPath = path.resolve(__dirname,'contracts','Inbox.sol')
const source = fs.readFileSync(inboxPath,'utf-8')
console.log(solc.compile(source,1));

react native android error after upgrade to 0.67.2 - SyntaxError: Unexpected token =

I have just upgraded from RN 0.63.3 to 0.67.2...and Im now receiving an error when I try to clean project in Android studio
....node_modules\#react-native-community\cli-plugin-metro\node_modules\metro\src\Server.js:350 processRequest = (req, res, next) => { ^SyntaxError: Unexpected token = at Module._compile (internal/modules/cjs/loader.js:721:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787: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:690:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (....node_modules\#react-native-community\cli-plugin-metro\node_modules\metro\src\shared\output\bundle.js:12:16) at Module._compile (internal/modules/cjs/loader.js:776:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
If you look at the file path its referring to (node_modules\#react-native-community\cli-plugin-metro\node_modules\metro\src\Server.js:350)...this is the line of code where its unhappy
processRequest = (req, res, next) => {
this._processRequest(req, res, next).catch(next);
};
Upgrading node to latest version fixed the issue

Invalid shorthand property initializer error connecting to Mongo DB Atlas

I want to connect my project to Mongo DB Atlas. It shows the following error while connecting the Database:
me :~/Desktop/prod$ npm run server
> #0.1.0 server /home/me/Desktop/
> nodemon server.js
[nodemon] 2.0.4 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): *.* [nodemon] watching extensions:
js,mjs,json [nodemon] starting `node server.js` Url/keys.js:2
mongoURI = "mongodb+srv://<username>:<password>#cluster0-ttxhq.mongodb.net/test"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid shorthand property initializer
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/saurabh/Desktop/prod/server.js:10:12)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10) [nodemon] app crashed - waiting for file changes before starting...
My code is :
const express = require("express")
const mongoose = require("mongoose")
const bodyParser = require("body-parser")
const app = express()
app.use(bodyParser.json())
const db = require("./config/keys").mongoURI
mongoose
.connect(db, {
useNewUrlParser: true,
useCreateIndex : true,
useUnifiedTopology : true
})
.then(()=>console.log("Database Connected"))
.catch(err => console.log(err))
const port = process.env.PORT || 5000
app.listen(port, ()=> console.log(`Server Starter on port ${port}`))
keys.js file is:*
modules.exports = {
mongoURI = "MONGODBURI"
}
Try:
modules.exports = {
mongoURI: "MONGODBURI"
}
This is a JSON so we cannot use '=' here.
have you tried IP whitelisting yourAtlas MongoDB cluster?
https://docs.atlas.mongodb.com/security-whitelist/
Medium tutorial

How to use ssr supported packages in vue with vue-server-renderer?

I tried to use vue2-google-maps and it worked well.
Suddenly my computer had stopped working and then I restarted my computer.
Then, strangely, 500-error comes out.
I reverted all codes associated with vue2-google-maps then my project works well.
Even though when I import vue2-google-maps then It occurs 500-error. :(
App.js
import * as VueGoogleMaps from 'vue2-google-maps';
It was working well but now cause of the unknown reason it has been broken...
Here is my console shows error.
webpack built 5410edae88d11b814c0b in 2690ms
error during render : /search
/media/bossminion/Work/WeMeet/frontend/node_modules/vue2-google-maps/dist/components/infoWindow.vue:3
<template>
^
SyntaxError: Unexpected token <
at Module._compile (internal/modules/cjs/loader.js:720:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/media/bossminion/Work/WeMeet/frontend/node_modules/vue2-google-maps/dist/main.js:42:19)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at r (/media/bossminion/Work/WeMeet/frontend/node_modules/vue-server-renderer/build.dev.js:9295:16)
at Object.<anonymous> (webpack:/external "vue2-google-maps":1:0)
at __webpack_require__ (webpack:/webpack/bootstrap a442baf8af813fadc2a4:25:0)
error during render : /favicon.ico
/media/bossminion/Work/WeMeet/frontend/node_modules/vue2-google-maps/dist/components/infoWindow.vue:3
<template>
^
SyntaxError: Unexpected token <
at Module._compile (internal/modules/cjs/loader.js:720:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/media/bossminion/Work/WeMeet/frontend/node_modules/vue2-google-maps/dist/main.js:42:19)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at r (/media/bossminion/Work/WeMeet/frontend/node_modules/vue-server-renderer/build.dev.js:9295:16)
at Object.<anonymous> (webpack:/external "vue2-google-maps":1:0)
at __webpack_require__ (webpack:/webpack/bootstrap a442baf8af813fadc2a4:25:0)
Is it possible that project that worked well could cause 500-error for no reason?
Environment: Ubuntu 18.04, npm v6.9.0, node v12.6.0
I have found how to handle ssr.
App.js
if (process.browser) {
const VueGoogleMaps = require('vue2-google-maps');
Vue.use(VueGoogleMaps, {
load: {
key: 'myKey',
libraries: 'places',
},
});
}
Instead of using import, I used require when it is client rendering.
I will be happy if it helped you. :D

Error: Cannot find module ' gulp-sass'

I'm having trouble getting gulp to read my modules.
Initially I had a working system.
I then upgraded to with NVM (I removed everything installed with Brew first)
Here's what I have now:
"node: v6.11.2"
"npm: 3.10.10"
"nvm"
and I have a gulpfile which used to work, but I also upgraded my modules, and I have installed locally in my project:
"gulp": "^3.9.1",
"gulp-pug": "^3.3.0",
"gulp-sass": "^3.1.0"
globally for this version of node I do have:
gulp-cli#1.4.0
jshint#2.9.5
npm#3.10.10
in a simple gulpfile running: gulp would work successfully, but introducing other modules is where I started getting issues.
In my gulpfile I have for example:
var gulp = require('gulp');
var sass = require(' gulp-sass'),
prefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-clean-css'),
sourcemaps = require('gulp-sourcemaps'),
rename = require("gulp-rename");
gulp.task('sass', function () {
return gulp.src(src.sass)
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(prefixer())
.pipe(gulp.dest(src.css))
.pipe(minifycss())
.pipe(rename({suffix: '.min'}))
.pipe(sourcemaps.write('/maps'))
.pipe(gulp.dest(src.css))
.pipe(connect.reload());
});
..locally running any command like gulp sass would produce:
Error: Cannot find module ' gulp-sass'
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/myusername/sites/projectname/gulpfile.js:25:12)
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)
I've removed the node_modules, removed the dependancies in package.json, reinstalled each local module
' gulp-sass' should be 'gulp-sass'
You are injecting a package with an additional space in the beginning of the package name. Remove the space and try it again.
var sass = require(' gulp-sass'),
should be
var sass = require('gulp-sass'),