Error: no writecb in Transform class.? - npm

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

Related

React-native-windows installation

I tried to install react-native-windows. I have some troubleshoot with the command:
npx react-native-windows-init --overwrite
NoLatestReactNativeWindows: Error: No version of react-native-windows#latest found
at getLatestRNWVersion (C:\Users\XXXX\AppData
Local\npm-cache_npx\966c6a96be6f5a32\node_modules\react-native-windows-init\src\Cli.ts:249:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Object.reactNativeWindowsInit (C:\Users\XXXX\AppData\Local\npm-cache_npx\966c6a96be6f5a32\node_modules\react-native-windows-init\src\Cli.ts:533:36) {
type: 'NoLatestReactNativeWindows',
data: undefined
}
Command failed. Re-run the command with --verbose for more information.

TypeError: undefined is not a function, js engine: hermes

My React Native (0.66.3) app today pops up an error with a stable code which hasn't had any change for quite some time. It is on macOS Big Sur. Here is the error:
ERROR TypeError: undefined is not a function, js engine: hermes
Error: ENOENT: no such file or directory, open '/Users/macair/Documents/code/js/xyz_app5/http:/localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.xyz-app5'
at Object.openSync (fs.js:498:3)
at Object.readFileSync (fs.js:394:35)
at getCodeFrame (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:919:18)
at Server._symbolicate (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:992:22)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Server._processRequest (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:403:7) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/Users/macair/Documents/code/js/xyz_app5/http:/localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.xyz-app5'
}
Here is the error displayed on IOS simulator:
The error seems related to metro in React Native.
Reinstall node_modules
rm -rf node_modules
Clean your cache
yarn cache clean (or npm cache clean –force)

How do I use Vite and Jest with IntelliJ?

I am trying to run a Jest integration test from Intellij. I right click and say run it tries to run but then I get...
/bin/sh: vite: command not found
I tried adding this to the env vars in the Intellij Run Dialog....
PATH=$PATH:/my/dir/node_modules/.bin
But then I get...
env: node: No such file or directory
node:events:371
throw er; // Unhandled 'error' event
^
Error: spawn pgrep ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn pgrep',
path: 'pgrep',
spawnargs: [ '-P', 6190 ]
}
I can confirm that vite is in /my/dir/node_modules/.bin and npx vite works from terminal. Vite is not (nor will I) installed globally
In my case I was using Puppeteer to run integration tests in the browser. Adding npm here...
module.exports = {
...
server: {
command: `npx vite --port 8080 --mode ${process.env.ENV_MODE || "development"}`,
port: 8080,
launchTimeout: 10000,
},
};
Notice was vite --port 8080 now npx vite --port 8080
This may not work with some older versions of NPM that don't include npx (don't remember version but think it is behind LTS).

Why does 'vue-cli-service build' fail after creating a new eslint-plugin, with error 'TypeError: eslint.CLIEngine is not a constructor'?

After creating a new eslint-plugin for a custom rule, vue-cli-service build fails (eslint works as expected, when triggered by ./node_modules/.bin/eslint --ext .js,.vue,.json ./ --max-warnings=0).
GitHub repository reproducing issue
Starting in an environment with a working vue-cli-service build, following the simplified instructions at https://blog.webiny.com/create-custom-eslint-rules-in-2-minutes-e3d41cb6a9a0, also reproduces the issue. Running vue-cli-service build after every step, it starts failing after step 4: yarn add --dev file:./eslint, and the build still fails after all the steps are completed.
Error message:
ERROR Failed to compile with 32 errors
Module build failed (from ./node_modules/#vue/cli-plugin-eslint/node_modules/eslint-loader/index.js):
TypeError: eslint.CLIEngine is not a constructor
at Object.module.exports (MYPATH/node_modules/#vue/cli-plugin-eslint/node_modules/eslint-loader/index.js:223:27)
***repeats 31 more times***
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
ERROR Build failed with errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
vue-cli-service build stills fails after running yarn install, which says it is already up to date.
Most results for this specific TypeError: eslint.CLIEngine is not a constructor error claim the user should upgrade their JetBrains IDE. However, I am running vue-cli-service build on the command line and not using JetBrains.
The code referred to by the error message is (with preceding context):
MYPATH/node_modules/#vue/cli-plugin-eslint/node_modules/eslint-loader/index.js
...
var config = assign(
// loader defaults
{
cacheIdentifier: JSON.stringify({
"eslint-loader": pkg.version,
eslint: eslintVersion || "unknown version"
}),
eslintPath: "eslint"
},
userOptions
);
if (typeof config.formatter === "string") {
try {
config.formatter = require(config.formatter);
if (
config.formatter &&
typeof config.formatter !== "function" &&
typeof config.formatter.default === "function"
) {
config.formatter = config.formatter.default;
}
} catch (_) {
// ignored
}
}
var cacheDirectory = config.cache;
var cacheIdentifier = config.cacheIdentifier;
delete config.cacheIdentifier;
// Create the engine only once per config
var configHash = objectHash(config);
if (!engines[configHash]) {
var eslint = require(config.eslintPath);
engines[configHash] = new eslint.CLIEngine(config); //Error happens here
}
...
Edit: I upgraded #vue/cli-plugin-eslint from version 3.11.0 to 4.1.2 by editing yarn's package.json, at the suggestion of #DelenaMalan below. The build still fails with error:
ERROR Failed to compile with 1 errors 7:51:01 PM
Module build failed (from ./node_modules/#vue/cli-service/node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
eslint.CLIEngine is not a constructor
at PoolWorker.fromErrorObj (MYPATH/node_modules/#vue/cli-service/node_modules/thread-loader/dist/WorkerPool.js:262:12)
at MYPATH/node_modules/#vue/cli-service/node_modules/thread-loader/dist/WorkerPool.js:204:29
at mapSeries (MYPATH/node_modules/neo-async/async.js:3625:14)
at PoolWorker.onWorkerMessage (MYPATH/node_modules/#vue/cli-service/node_modules/thread-loader/dist/WorkerPool.js:170:35)
at readBuffer (MYPATH/node_modules/#vue/cli-service/node_modules/thread-loader/dist/WorkerPool.js:152:14)
at Object.module.exports (MYPATH/node_modules/#vue/cli-plugin-eslint/node_modules/eslint-loader/index.js:223:27)
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
ERROR Build failed with errors.
error Command failed with exit code 1.
Edit 2:
I deleted and reinstalled the node modules on the repro linked here, as recommended by #CGundlach, but I still have the eslint.CLIEngine is not a constructor error
Annas-MacBook-Pro:eslint-test-project anna$ rm -rf node_modules/
Annas-MacBook-Pro:eslint-test-project anna$ yarn install
yarn install v1.21.1
[1/4] πŸ” Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] πŸ”— Linking dependencies...
warning "#vue/eslint-config-airbnb > eslint-import-resolver-webpack#0.11.1" has unmet peer dependency "webpack#>=1.11.0".
[4/4] πŸ”¨ Building fresh packages...
✨ Done in 14.14s.
Annas-MacBook-Pro:eslint-test-project anna$ yarn build
yarn run v1.21.1
$ vue-cli-service build
⠏ Building for production...
ERROR Failed to compile with 1 errors 12:28:32 PM
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
eslint.CLIEngine is not a constructor
at PoolWorker.fromErrorObj (/Users/anna/projects/yarn-vue-eslint/eslint-test-project/node_modules/thread-loader/dist/WorkerPool.js:262:12)
at /Users/anna/projects/yarn-vue-eslint/eslint-test-project/node_modules/thread-loader/dist/WorkerPool.js:204:29
at mapSeries (/Users/anna/projects/yarn-vue-eslint/eslint-test-project/node_modules/neo-async/async.js:3625:14)
at PoolWorker.onWorkerMessage (/Users/anna/projects/yarn-vue-eslint/eslint-test-project/node_modules/thread-loader/dist/WorkerPool.js:170:35)
at readBuffer (/Users/anna/projects/yarn-vue-eslint/eslint-test-project/node_modules/thread-loader/dist/WorkerPool.js:152:14)
at Object.module.exports (/Users/anna/projects/yarn-vue-eslint/eslint-test-project/node_modules/eslint-loader/index.js:223:27)
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
ERROR Build failed with errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Make sure all warnings are resolved when you run either npm ci, npm i or yarn install. For me the following warnings were showed after doing a fresh install:
$ vue-cli-service build
β § Building for production...
ERROR Failed to compile with 1 error 20:47:55
Syntax Error: Thread Loader (Worker 0)
eslint.CLIEngine is not a constructor
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
When I did a fresh install and resolved the peer dependency issue by decreasing my eslint version everything works as expected.
So try to downgrade your eslint dependency to the correct version. For me I had to downgrade to eslint < 7.0.0.
npm i -D eslint#6.8.0
# or yarn
yarn add -D eslint#6.8.0

Puppeteer script suddenly stopped working after upgrading Puppeteer

I have a puppeteer script I run to reboot my modem. It has worked for I guess about a year with no problem. 5 days ago it stopped working. I was looking into it and realized that I am getting errors I didn't used to get when running it and the script fails. The thing is I didn't change anything. As far as I can see, the HTML hasn't changed either yet it is failing. So I wonder if there is a bug in chromium or puppeteer or if it handles things differently somehow?
Here's a codepen with https://codepen.io/michaelbierman/pen/qQjdYR
HTML page
puppeteer script
errors
ERROR OUTPUT
Thursday 11/15/2018 11:14:04, Login...
Unhandled Rejection at: Promise (new page) Promise {
Error: No node found for selector: #id_username
at assert (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:278:11)
at Frame.type (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/FrameManager.js:771:5)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
-- ASYNC --
at Frame. (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:144:27)
at Page.type (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/Page.js:971:29)
at /Users/bierman/Documents/Applications/bin/arris/arristest.js:49:13
at
at process._tickCallback (internal/process/next_tick.js:188:7) } reason: Error: No node found for selector: #id_username
at assert (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:278:11)
at Frame.type (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/FrameManager.js:771:5)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
-- ASYNC --
at Frame. (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:144:27)
at Page.type (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/Page.js:971:29)
at /Users/bierman/Documents/Applications/bin/arris/arristest.js:49:13
at
at process._tickCallback (internal/process/next_tick.js:188:7)
/Users/bierman/Documents/Applications/bin/arris/arristest.js:29
browser.close();
^
ReferenceError: browser is not defined
at process.on (/Users/bierman/Documents/Applications/bin/arris/arristest.js:29:2)
at emitTwo (events.js:126:13)
at process.emit (events.js:214:7)
at emitPendingUnhandledRejections (internal/process/promises.js:108:22)
at process._tickCallback (internal/process/next_tick.js:189:7)
BigMac:bin michael$ /usr/local/bin/node /Users/bierman/Documents/Applications/bin/arris/arristest.js
Thursday 11/15/2018 11:20:29, Login...
Thursday 11/15/2018 11:20:36, Go to home...
Unhandled Rejection at: Promise (new page) Promise {
Error: No node found for selector: #alertExitButton
at assert (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:278:11)
at Frame.click (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/FrameManager.js:704:5)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
-- ASYNC --
at Frame. (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:144:27)
at Page.click (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/Page.js:932:29)
at /Users/bierman/Documents/Applications/bin/arris/arristest.js:62:13
at
at process._tickCallback (internal/process/next_tick.js:188:7) } reason: Error: No node found for selector: #alertExitButton
at assert (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:278:11)
at Frame.click (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/FrameManager.js:704:5)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
-- ASYNC --
at Frame. (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/helper.js:144:27)
at Page.click (/Users/bierman/Documents/Applications/bin/arris/node_modules/puppeteer/lib/Page.js:932:29)
at /Users/bierman/Documents/Applications/bin/arris/arristest.js:62:13
at
at process._tickCallback (internal/process/next_tick.js:188:7)
/Users/bierman/Documents/Applications/bin/arris/arristest.js:29
browser.close();
^
ReferenceError: browser is not defined
at process.on (/Users/bierman/Documents/Applications/bin/arris/arristest.js:29:2)
at emitTwo (events.js:126:13)
at process.emit (events.js:214:7)
at emitPendingUnhandledRejections (internal/process/promises.js:108:22)
at process._tickCallback (internal/process/next_tick.js:189:7)
Try this:
npm uninstall chromium
npm uninstall puppeteer
npm i chromium#1
npm i puppeteer