TypeError: 'undefined is not a function when' installing new keystonejs application - keystonejs

I am following this steps :
http://keystonejs.com/getting-started/
nodejs - v0.12.7
mongod - db version v3.2.0
but I am getting the error below
} if (userModelPath.includes('-')) { ;
^
TypeError: undefined is not a function
at eval (eval at template (/usr/local/lib/node_modules/generator-keystone/node_modules/yeoman-generator/node_modules/lodash/dist/lodash.js:6306:22), <anonymous>:77:22)
at KeystoneGenerator.underscore [as _engine] (/usr/local/lib/node_modules/generator-keystone/node_modules/yeoman-generator/lib/util/engines.js:31:45)
at KeystoneGenerator.engine (/usr/local/lib/node_modules/generator-keystone/node_modules/yeoman-generator/lib/actions/actions.js:314:10)
at KeystoneGenerator.template (/usr/local/lib/node_modules/generator-keystone/node_modules/yeoman-generator/lib/actions/actions.js:289:15)
at KeystoneGenerator.project (/usr/local/lib/node_modules/generator-keystone/app/index.js:320:7)
at /usr/local/lib/node_modules/generator-keystone/node_modules/yeoman-generator/lib/base.js:395:14
at processImmediate [as _immediateCallback] (timers.js:367:17)
Sergius-MacBook-Pro:keystoneadmin sergiu$

You need to update your version of Node.js
String.prototype.includes() was most likely String.prototype.contains() in your version of Node.js

Related

Error: getaddrinfo EAI_AGAIN undefined (ldapjs)

So, i tried to deploy my Express.Js app to my vps, but I get some error that refined to Error: getaddrinfo EAI_AGAIN undefined. The weird part is, it is doing just fine if I run this app on my localhost. Any body knows how to resolve this issue?
Here are the error log that I get.
events.js:187
throw er; // Unhandled 'error' event
^
Error: getaddrinfo EAI_AGAIN undefined
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)
Emitted 'error' event on Client instance at:
at Backoff.<anonymous> (/home/user/deploy-folder/app-api/node_modules/ldapjs/lib/client/client.js:1228:12)
at Backoff.emit (events.js:210:5)
at Backoff.backoff (/home/user/deploy-folder/app-api/node_modules/ldapjs/node_modules/backoff/lib/backoff.js:41:14)
at /home/user/deploy-folder/app-api/node_modules/ldapjs/lib/client/client.js:1214:15
at f (/home/user/deploy-folder/app-api/node_modules/ldapjs/node_modules/once/once.js:25:25)
at Socket.onResult (/home/user/deploy-folder/app-api/node_modules/ldapjs/lib/client/client.js:1016:7)
at Object.onceWrapper (events.js:300:26)
at Socket.emit (events.js:210:5)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) {
errno: 'EAI_AGAIN',
code: 'EAI_AGAIN',
syscall: 'getaddrinfo',
hostname: 'undefined'
I assume that by now you discovered the error, but in this particular case it seems that the variable you are using to setup ldap is not stated or resolves to undefined.
The proper way to do it according to the documentation is this:
var ldap = require('ldapjs');
var client = ldap.createClient({
url: 'ldap://127.0.0.1:1389'
});

Where is NPM config file?

I edited the npm config file with npm edit config. I made a syntax error in it and saved the file. Now, no matter what I try with npm, it will complain about it. I know what the syntax is and I would like to fix it, but I can't find the file anywhere.
C:\Users\Arthur>npm
Error: Failed parsing JSON config key cache: "C:\Users\Le Roi Arthur\AppData\Roaming\npm-cache"
at parseField (D:\nodejs\node_modules\npm\lib\config\core.js:376:13)
at D:\nodejs\node_modules\npm\lib\config\core.js:330:24
at Array.forEach (<anonymous>)
at Conf.add (D:\nodejs\node_modules\npm\lib\config\core.js:328:23)
at ConfigChain.addString (D:\nodejs\node_modules\npm\node_modules\config-chain\index.js:244:8)
at Conf.<anonymous> (D:\nodejs\node_modules\npm\lib\config\core.js:316:10)
at D:\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:90:16
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
TypeError: Cannot read property 'loaded' of undefined
at exit (D:\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
at errorHandler (D:\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
at D:\nodejs\node_modules\npm\bin\npm-cli.js:77:20
at cb (D:\nodejs\node_modules\npm\lib\npm.js:225:22)
at D:\nodejs\node_modules\npm\lib\npm.js:263:24
at D:\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at Conf.<anonymous> (D:\nodejs\node_modules\npm\lib\config\core.js:82:13)
at Conf.f (D:\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at Object.onceWrapper (events.js:286:20)
D:\nodejs\node_modules\npm\lib\utils\error-handler.js:98
var doExit = npm.config.loaded ? npm.config.get('_exit') : true
^
TypeError: Cannot read property 'loaded' of undefined
at exit (D:\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
at process.errorHandler (D:\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
at process.emit (events.js:198:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
Error: Failed parsing JSON config key cache: "C:\Users\Le Roi Arthur\AppData\Roaming\npm-cache"
at parseField (D:\nodejs\node_modules\npm\lib\config\core.js:376:13)
at D:\nodejs\node_modules\npm\lib\config\core.js:330:24
at Array.forEach (<anonymous>)
at Conf.add (D:\nodejs\node_modules\npm\lib\config\core.js:328:23)
at ConfigChain.addString (D:\nodejs\node_modules\npm\node_modules\config-chain\index.js:244:8)
at Conf.<anonymous> (D:\nodejs\node_modules\npm\lib\config\core.js:316:10)
at D:\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:90:16
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
TypeError: Cannot read property 'loaded' of undefined
at exit (D:\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
at errorHandler (D:\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
at D:\nodejs\node_modules\npm\bin\npm-cli.js:77:20
at cb (D:\nodejs\node_modules\npm\lib\npm.js:225:22)
at D:\nodejs\node_modules\npm\lib\npm.js:263:24
at D:\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at Conf.<anonymous> (D:\nodejs\node_modules\npm\lib\config\core.js:82:13)
at Conf.f (D:\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at Object.onceWrapper (events.js:286:20)
D:\nodejs\node_modules\npm\lib\utils\error-handler.js:98
var doExit = npm.config.loaded ? npm.config.get('_exit') : true
^
TypeError: Cannot read property 'loaded' of undefined
at exit (D:\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
at process.errorHandler (D:\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
at process.emit (events.js:198:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
Uninstalling and re-installing nodeJS doesn't fix the issue, the file is stored in cache somewhere. It's infuriately frustrating how hard it is to put my hands on that file.
Where can I find the npm config file ?
You need to edit npmrc file, take a look at documentation it will help you to find the appropriate one.
The four relevant files are:
Per-project config file: /path/to/my/project/.npmrc
Per-user config file: ~/.npmrc
Global config file: $PREFIX/npmrc
Built-in npm config file: /path/to/npm/npmrc
you can see the config file (and other) paths with the below command
npm config list

Cannot create vue project using vue/cli

Version vue: 3.7.0
When I type in CMD:
vue create "projectname"
I get the following response:
assert.js:85
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: 5895 == 0
at ClientRequest.onConnect (C:\Users\mikag\AppData\Roaming\npm\node_modules\#vue\cli\node_modules\tunnel-agent\index.js:160:14)
at Object.onceWrapper (events.js:277:13)
at ClientRequest.emit (events.js:189:13)
at Socket.socketOnData (_http_client.js:475:11)
at Socket.emit (events.js:189:13)
at addChunk (_stream_readable.js:284:12)
at readableAddChunk (_stream_readable.js:265:11)
at Socket.Readable.push (_stream_readable.js:220:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
CMD SCREEN
Have you tried with NodeJS v12.1.0, as it is supposed to be fixed by now.
This is one of the known issues, as per: https://github.com/vuejs/vue-cli/issues/3883

React Packager 0.44.0

First of all I am new to react native platform and I am developing an app but I am facing one issue when I run my application after changes made in classes.
I am posting my logs below, Thank you for your help folks....
index.android.js (loads successfully but app do not run)
SyntaxError: Unexpected end of JSON input
at parse (<anonymous>)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
SyntaxError: Unexpected end of JSON input
at parse (<anonymous>)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
{
Error: write EPIPE
at _errnoException (util.js:1022:11)
at Socket._writeGeneric (net.js:767:25)
at Socket._write (net.js:786:8)
at doWrite (_stream_writable.js:387:12)
at writeOrBuffer (_stream_writable.js:373:5)
at Socket.Writable.write (_stream_writable.js:290:11)
at Socket.write (net.js:704:40)
at Socket.Writable.end (_stream_writable.js:553:10)
at Socket.end (net.js:496:31)
at Promise.resolve.then.then.then.catch.then.message
(E:\FinalDownload\takeawaymobileapp\node_modules\react-native\packager\src\Server\symbolicate\worker.js
:35:33) code: 'EPIPE', errno: 'EPIPE', syscall: 'write' }

Error: no writecb in Transform class.?

Good day. Help me please.
There are some versions.
npm v3.10.6
node v4.5.
"gulp-file-include": "^0.14.0",
"gulp-remove-html": "^1.1.2"
There is part of gulpfile.js
fileinclude = require('gulp-file-include'),
gulpRemoveHtml = require('gulp-remove-html')
gulp.task('buildhtml', function() {
gulp.src(['app/*.html'])
.pipe(fileinclude({
prefix: '##'
}))
.pipe(gulpRemoveHtml())
.pipe(gulp.dest('dist/'));
});
There is result after running "gulp buildhtml". The problem appears today.
[11:31:46] Starting 'buildhtml'... [11:31:46] Finished 'buildhtml' after 8.83 ms events.js:141
throw er; // Unhandled 'error' event
^
Error: no writecb in Transform class
at afterTransform (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:74:40)
at TransformState.afterTransform (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:58:12)
at DestroyableTransform.fileInclude [as _transform] (C:\Projects\Projects\project1\node_modules\gulp-file-include\lib\index.js:49:9)
at DestroyableTransform.Transform._read (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:159:10)
at DestroyableTransform.Transform._write (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:147:83)
at doWrite (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:313:64)
at writeOrBuffer (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:302:5)
at DestroyableTransform.Writable.write (C:\Projects\Projects\project1\node_modules\gulp-file-include\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:241:11)
at write (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:623:24)
at flow (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:664:5)
at emitNone (events.js:67:13)
at DestroyableTransform.emit (events.js:166:7)
at emitReadable_ (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:448:10)
at emitReadable (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:444:5)
at readableAddChunk (C:\Projects\Projects\project1\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:187:9)
If you use Gulp 4.0 alpha 3, Downgrade to Gulp 4.0 alpha 2 with
npm install -S gulpjs/gulp#6d71a65