Tag Archives: node.js

Error 2052/2053 when installing node.js in win

It is generally caused by the lack of installation permission of the software package

solve:

1. Put the software package node-v14.17.3-x64.msi on the desktop, download address: https://nodejs.org/en/download/

2. Run as a management manager:

3. Install in the specified directory

C:\Windows>cd C:\Users\pert\Desktop
C:\Users\pert\Desktop>msiexec /package node-v14.17.3-x64.msi

This is how to install the software

Next, configure the environment variables and specify the directory

reference resources https://blog.csdn.net/antma/article/details/86104068

[Solved] This is probably not a problem with npm. There is likely additional logging output above.

If this error occurs, you need to re install the node_ Contents in the modules folder   But before installing, you should clear all the previous contents. The steps are as follows:

1. Delete the node first_ modules

rmdir /s/q node_modules

2.delete package-lock.json file
3.npm cache clean –force
4.npm install(npm i is ok)

Typeerror in gitbook init: cb.apply is not a function solution

The following error occurred when executing gitbook init:

Find the prompt path, open the polyfills.js file, and find this function

This function is called on lines 65-67

fs.stat = statFix(fs.stat)
fs.fstat = statFix(fs.fstat)
fs.lstat = statFix(fs.lstat)

Comment out the three lines of code to solve the problem

Because of the NPM version problem, you can refer to the following two methods to solve. However, we must pay attention to which polyfills.js has a problem, which is explained in detail in the error prompt.

Recommended reading:
1 https://blog.csdn.net/yq_ forever/article/details/112121742
https://www.cnblogs.com/cyxroot/p/13754475.html

[Solved] ERROR command failed: npm install –loglevel error –legacy-peer-deps

When I created a new Vue project today, I made a mistake like the title, which was disgusting at that time

Try the method of online God

Find the content to be modified by C:: (users/owner). Vuerc  “ Usetaobaoregistry “: false, if the value is true or false, it is not easy to use

Then a whim called CMD as administrator to recreate the project successfully

For reference only, by the way, ask if there is a big God how to solve this problem: how to make the CMD run smoothly under the permission of non administrator?

After node.js is installed, use the instruction node version in vscode to show that it is not an external or internal instruction. The solution is as follows:

**

After node.js is installed, use the instruction node version in vscode to show that it is not an external or internal instruction. The solution is as follows:

**

Method 1: restart vscode, and then re-enter node — version (1) find the code.exe file
(2) right click the properties
(3) after opening the compatibility, select to run the program as an administrator and click OK
(4) in the last step, restart vscode and re-enter node — version

Vue introduction path is correct, but it always reports an error: already included file name‘ ××ב differs from file name ‘ ××ב only in casing.

Vue import path ××× from ‘ ×××’ Error
the file name and address introduced are correct, but the error is still reported
already included file name‘ ×××’ differs from file name ‘ ×××’ only in casing.

At this time, we just need to remove the suffix Vue of the file name
solution

Solution 1: remove the suffix Vue of the file name

Solution 2: change the point in front of the path to@

Path

function

./

current file sibling directory

./

current file superior directory

@

when importing a module, you can use @ instead of/SRC directory to refer to the relative path

TypeError: connection.connect is not a function

Today, when I wrote node.js to operate the database, I encountered a typeerror: connection.connect is not a function when setting up the database connection. The following is the bug prompt, as shown in the figure

when I found this error, I immediately went to connection.connect, but I didn’t find anything wrong,
For this reason, I made a special effort to find the previous code and compare it. The following is the thinking at that time

later, I asked my friend to check the custom module
PS: after staring at it for more than ten minutes, I didn’t find the error. At this moment, I felt like a mentally retarded person

later, I had to check one by one, I found that my mistake was to write the return value of the function as an object….. Verification complete….. Retarded stone hammer…..

Change it to the following way

rerun

Solving the problem of joi. Validate is not a function

Question:

When writing about the running of the project, the problem of joi. Validate is not a function appears

#Reason:

After checking, it is possible that the third-party module joi was not downloaded or the version is wrong

solve:

Open the PowerShell and uninstall the joi if it has been downloaded:

npm uninstall joi

Then download the module again, joi:

npm install joi

Node rerun project

Using webpack to report typeerror: this.getresolve is not a function

##Using webpack to report typeerror: this.getresolve is not a function

###Error reason: the webpack version is too low or the loader version is too high

this is the original configuration version

##Solutions:
1. Upgrade the version of webpack to the highest version (there are many changes in the version of webpack, so I’m afraid it won’t catch up with others, So you can choose not to change the webpack version)
2. Reduce the version of the loader
(1) manually reduce the downloaded version of the loader in package.json

(2) download the loader you just used again

and then run it again

When writing a website, Vue + Flash prompts network error when visiting Vue page

Flash page is mounted at 127.0.0.1:8010
Vue page is mounted at 127.0.0.1:8080 (Axios. Defaults. Baseurl)=‘ http://127.0.0.1 :8010’)

After running, you can access port 8010, but when you access port 8080, you will be prompted with network error, and the security group port will be set to
after checking, it is found that port 8010 is forward to port 1527

guess that port 8010 is occupied
after a look, it is really

so you can directly modify the page port in app.py to 5000,
axios.defaults.baseURL = ‘ http://127.0.0.1 : 5000 ‘(or other non conflicting ports)

This time, you can directly access port 8080
it is found that using ‘127.0.0.1’ can still achieve public network page projection, but only using ‘0.0.0.0’ for flash

[Solved] Vue cli installation Fastclick Error

When I installed the fastsclick package into the vue-cli dependency today, it reported an error saying

$ npm install fastclick –save
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npm.taobao.org/fastclick failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.org
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network ‘proxy’ config is set properly. See: ‘npm help config’
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2021-04-15T12_07_17_780Z-debug.log

Eventually switched to a different installation, typing in the command line.

cnpm install fastclick –save
Success