Tag Archives: node.js

SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX

…2222312; and 20064; and to authenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthenticauthentic2222222222222222222222222222222222222222222222220; and to your 20340; and to 382382382; and to 38203822222222222220; and to 3823820;.382222222222222220;.1997992;65292. usr/bin/python3
35;–coding: UTF-8
import os, sys

*25171;*24320;*20214

fd = os.open(“C:Users\ericDesktoppythonfoot.txt”, os.o.o. RDWR 124os.o. CREAT)

*22797;*21046;*20214;*2551;*36848;*31526;

d o u fd= os.dup(fd)

.20351; -29992; -22797; -21046; -30340; -20214; -2551; -36848; -31526; -20889; -20837;*

os.write(d.u fd, “This is test”.encode())

*20851;*38381;*20214

closerange(fd, d.u.fd)

print (“20851;”38381;”25152;”26377;”20214;”25104;”21151!!”

File, line 6.br> fd.open(“C:Users s\eric\Desktoppython\foot.txt”, as.O.R.WR124.o.o.CREAT
SyntaxErro: (unicoerror)’unicodeescapcan’codecan’t decodes in 2-3-3-position: trun244..23601;-26159;65306;SyntaxError:-652881;unicorn 38169;-3582365289; ‘Unico-Scape’int32534;’352991.30721;’222212080;’and.35861;’3072122222-30120013;’30340;* and 33410410;6530630130000;’260290290;UX br>382;’39064;’280-78530630620303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030663;.xx26159;65292;x24517;.21435;.25481;.36716;.20041;20.br>26041;.27861;.19968;6530630621152;r242437821046;’2121991;.e36716;.20016;.20041;and 20999999990;.26041;.26041;.222222222222209999999999999999999999996;;;;,1963063066306669666669999999999999999999996ericDesktoppythonfoot.txt”, os.o. RDWR 124s.o.o. CREAT
26041; 27861; 653062.
fd open(“C:Users\eric Desktoppythonfoot.txt o.O.R.R.124s.O.CREAT
26041;<27861;
19977;65306;27491;<26012;<464;<27861 br> fd.open(“C:/Users/eric/Desktop/python/foot.txt”), O.b.

Cannot read property ‘isFile‘ of undefined [How to Solve]

Today, when I started the project, I couldn’t get up. I always reported an error. After translation research, I came to the solution

When executing Vue project NPM run dev FileManager webpack plugin error typeerror: cannot read property 'isfile' of undefined

D:\abinwork\fmis_web\node_modules\filemanager-webpack-plugin\lib\index.js:271
        if (isGlob) archive.glob(command.source, globOptions);else if (sStats.isFile()) archive.file(command.source, { 
        name: path$1.basename(command.source) });else if (sStats.isDirectory()) archive.glob('**/*', {
                                                                              ^

TypeError: Cannot read property 'isFile' of undefined
    at D:\abinwork\fmis_web\node_modules\filemanager-webpack-plugin\lib\index.js:271:79
    at D:\abinwork\fmis_web\node_modules\graceful-fs\polyfills.js:282:31

The reason for the error is very simple, because the project we just pulled down does not have a dist directory, and then FileManager webpack plugin find a dist directory and find that it does not exist, and then strike and quit, resulting in an error;

There are two solutions

First, you can repackage it;

npm run build

Second, modify the configuration and automatically create the dist directory when running

Note: look at the first step first. If you can run the NPM run build and then the NPM run dev project, you don’t have to perform the second step

plugins: [
    new FileManagerWebpackPlugin ({
      onEnd: {
        mkdir: [‘./dist‘],
        delete: [
          ‘./dist.zip‘,
        ],
        archive: [
          {source: ‘./dist‘, destination: ‘./dist.zip‘},
        ]
      }
    })
  ],

Antdesignvue autocomplet completes the problem of repeated error reporting

If the data IDs are different, and there are multiple identical name values or multiple identical Title values, an error will be reported
just do it

    <a-auto-complete
      v-model="ruleForm.companyId"
        placeholder="Please Input"
        optionLabelProp="label"
        @select="onSelect"
        @change="onChangeStore"
      >
        <template slot="dataSource">
          <a-select-option
            v-for="item in dataSource"
            :key="item.id"
            :value="item.id + ''"
            :label="item.name"
          >
            {{ item.name }}
          </a-select-option>
        </template>
    </a-auto-complete>

Vue project reports an error on ie11 white screen. Script1002: syntax error

Problem phenomenon

The project is a front-end project built with Vue/cli3 scaffold, and Vue version is 2.6.10.

Ie11 error reporting problems are as follows:

  (there was no screenshot in the error report at that time, but someone else’s picture was used)

 

It’s annoying that there’s no way to check mistakes like this

Baidu a pile, all copy to copy, the key has not been able to solve the problem, shit! Omnipotent Google up

  In fact, this problem is obviously a syntax error, that is, the problem that ie does not support, ie garbage

Since it’s a syntax problem, it’s a compilation problem. Let’s directly compile the corresponding package, but which package is it

Here’s the point: when you click the error message, you will find that the place where the breakpoint is is the place where the error is reported. That must be the problem here, but this is the compiled code. How to check which package is a headache!

When I was having a headache, I found that the comment above was the name of the package???

It’s like discovering a new world

It’s him. This picture is not my error information. My error information is

./node_modules/[email protected]@js-base64.js

Since the package with the problem is found, specify that it be compiled; Using webpack

Directly configure the compiled code in vue.config.js

transpileDependencies: [
    /[/\\]node_modules[/\\][email protected]@js-base64[/\\]/,
 ],

Then directly NPM run serve

be accomplished! It’s done! go off work!

Error: PostCSS plugin postcss-pxtorem requires PostCSS 8

Question content:

Syntax Error: Error: PostCSS plugin postcss-pxtorem requires PostCSS 8.
Migration guide for end-users:
https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users


 @ ./src/styles/index.less 4:14-228 15:3-20:5 16:22-236
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.7.176:8081&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

Problem solving:

npm i [email protected]

Error “NPM err” when starting Vue project! code ELIFECYCLE”

Since NPM and cnpm have been used together before, there is no problem. Today, when starting the Vue project, I encountered an error “NPM”   ERR!   code   “Elifecycle” was initially used with NPM   Run started and later changed to cnpm   Neither can run.

  After checking the information, it is mostly said on the Internet that it is because of node_ There is a problem with the installation of modules. The basic solution is to clear the cache and reinstall.

The following steps are summarized:

1、npm   cache   clean  — force

2、rm  – rf   node_ modules

3、rm  – rf   Package-lock.json (optional)

4、npm   install

 

 

Error in legal external terminal in ANSYS electronics desktop

report errors     Illegal external terminal ‘CoilTerminal1’: An external terminal must border the edge of the problem region and coincides with the surface of a 3D object

Solution: the surface of the excitation port you set (that is, where the current flows in and out) should coincide with the vacuum package you set (that is, the surface of the region).

[Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined

Syntax Error: TypeError: Cannot read property ‘parseComponent’ of undefined
Vue packages version mismatch

Failed to compile.

./src/App.vue
Module Error (from ./node_modules/vue-loader/lib/index.js):


Vue packages version mismatch:

- [email protected] (D:\site\hst_tech\hst_platform_frontend\node_modules\vue\dist\vue.runtime.common.js)
- [email protected] (D:\site\hst_tech\hst_platform_frontend\node_modules\vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

Solution:

Set Vue template- [email protected] Version change Vue template- [email protected]

// Just change the version number to the same one
npm i -g [email protected] --save

Error code 1 error resolution (NPX create react app my app execution reports an error)

npm ERR! code 1
npm ERR! path /Volumes/D/HTML/vscodework/react/my-app/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! Package pangocairo was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pangocairo.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pangocairo' found
npm ERR! gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Volumes/D/HTML/vscodework/react/my-app/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Volumes/D/HTML/vscodework/react/my-app/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Volumes/D/HTML/vscodework/react/my-app/node_modules/canvas
npm ERR! gyp ERR! node -v v14.17.5
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:

Problem solving: install dependent Libraries

brew install pkg-config cairo pango

Check the functions of these databases:

PKG config: used to return installation library information

Cairo: a free drawing library

Pango: a free function library

I don’t know what to do after checking. It’s good anyway!

[Solved] Project Package Error: Javascript heap out of memory

Project package error:JavaScript heap out of memory
1、Modify package.json add –max_old_space_size=8192

"pro": "cross-env NODE_ENV=production node --max_old_space_size=8192 ./dist/server/server.js",

2. Execute increase memory limit


// global install
npm i -g increase-memory-limit

// into the project
increase-memory-limit

Error JavaScript heap out of memory means that the JavaScript heap is out of memory. JavaScript here refers to node. We all know that node is based on V8 engine. In general back-end development languages, there are no restrictions on the use of basic memory. However, when using memory through JavaScript in node, only part of the memory can be used (about 1.4 GB in 64 bit system and about 0.7 GB in 32-bit system). If the front-end project is too large, webpack compilation will occupy a lot of system resources. When it exceeds the default memory limit of V8 for node, memory leakage will occur.

[Solved] Error: unable to verify the first certificate

Many options have been set on win10, but the error is still reported: unable to verify the first certificate

$ yarn config list
yarn config v1.22.4
info yarn config
{
  'version-tag-prefix': 'v',
  'version-git-tag': true,
  'version-commit-hooks': true,
  'version-git-sign': false,
  'version-git-message': 'v%s',
  'init-version': '1.0.0',
  'init-license': 'MIT',
  'save-prefix': '^',
  'bin-links': true,
  'ignore-scripts': false,
  'ignore-optional': false,
  registry: 'http://npm.xxxxx.com',
  'strict-ssl': false,
  'user-agent': 'yarn/1.22.4 npm/?node/v12.22.1 win32 x64',
  NODE_TLS_REJECT_UNAUTHORIZED: 0,
  lastUpdateCheck: 1629361331003
}
info npm config
{
  registry: 'http://npm.xxxxx.com',
  CYPRESS_INSTALL_BINARY: 'https://npm.taobao.org/mirrors/cypress/5.6.0/darwin-x64/cypress.zip',
  '//arch': 'ia32',
  '//registry': 'https://registry.npm.taobao.org',
  electron_mirror: 'https://npm.taobao.org/mirrors/electron/',
  CHROMEDRIVER_CDNURL: 'http://npm.taobao.org/mirrors/chromedriver/',
  sass_binary_site: 'https://npm.taobao.org/mirrors/node-sass/',
  phantomjs_cdnurl: 'https://npm.taobao.org/mirrors/phantomjs',
  'strict-ssl': false,
  proxy: null,
  'https-proxy': null,
  '//npm.xxxxx.com/:_authToken': '8624c0fe-ea43-4f30-b113-617f22e9c6c6'
}

Solution:

NODE_TLS_REJECT_UNAUTHORIZED=0 yarn

Puppeteer Error: Chromium revision is not downloaded. Run “npm install“ or “yarn install“

1. Introduction

Running after local installation, it is found that chromium has not been downloaded

2. Solution

Look at the information carefully

npm install [email protected]

> [email protected] install D:\workspace\team\takewalk\TakeWalks-FrontEnd\node_modules\puppeteer
> node install.js

**INFO** Skipping browser download. "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" environment variable was found.

The environment variable has been set before. You can delete it