Tag Archives: node . js

How to Solve Node start error listen eacces 0.0.0.0:810

Error Message:
events. js:141
throw er; // Unhandled ‘error’ event
^
Error: listen EACCES 0.0.0.0:80
at Object.exports. _errnoException (util.js:870:11)
at exports. _exceptionWithHostPort (util.js:893:20)
at Server. _listen2 (net.js:1224:19)
at listen (net.js:1273:10)
at net. js:1382:9
at nextTickCallbackWith3Args (node.js:452:9)
at process. _tickCallback (node.js:358:17)
at Function.Module.runMain (module.js:444:11)
at startup (node.js:136:18)
at node.js:966:3
———————————-

1. one is the port is occupied
2. sudo node xx. js — root privileges are required to access ports below 1024

 

CreateProcess error=193, %1 is not a valid Win32 application

 
Error: Failed to execute goal com. Making. Eirslett: frontend – maven – XXXXXXXX
You can perform MVN Clean Package-e viewing, which will wrap and display more detailed error information
The error message is CreateProcess error=193, %1 is not an valid Win32 Application.
The Frontend – Maven-Plugin’s GtiHub has an explanation for an error
https://github.com/eirslett/frontend-maven-plugin/issues/487
 

Cannot find module ‘lodash’

The scenarios in which this problem occurs vary, but the solutions are basically the same. This article takes lodash module as an example

    if Cannot find module lodash appears after the pull code is run, usually someone else USES a plug-in lodash, but you do not have it in your local environment, you can directly go to the package. Json to check if there is lodash, if there is, that proves that you do not install the lodash, use CNPM install to install it. Json package.json not found, Cannot find module lodash, global search under the file lodash, if the file is not used, then delete node_module, re-use CNPM install can be installed; Json . Just ask the relevant person to submit it, and then refer to step 1. Json, node_module package-lock. Use NPM cache clean --force to clear the cache. Then use NPM install to install.

Json copy a copy of packing-lock-. jsoncopy a copy of packing-lock. jsoncopy a copy of packing-lock. json copy a copy of packing-lock-. (Of course, if the file is u update status, then don't bother, check the update content, and then submit it)

npm ERR! Error: EPERM: operation not permitted, open ‘C:\Program Files\nodejs\node_ Solution to cache / xxx

Problem: When installing NPM I VUe-CLI-g, an error is reported as the problem message
General solutions (for Windows 10) :
Method 1: Click the search button at the bottom left of the screen, search for the keyword ‘command prompt’, right-click, and run as an administrator.
Method two: right click window badge or Window + X in the lower left of the screen, run as an administrator (Windows PowerShell (administrator)), you can.
This method is suitable for permission problems.

ERROR Plugin load failed: hexo-admin Error: EISDIR: illegal operation on a directory, read ERROR Dep

ERROR Plugin load failed: hexo-admin
Error: EISDIR: illegal operation on a directory, read
ERROR Deployer not found: Git
git terminal to the wrong, then I am in what cases reported in, is to build a personal blog, the day before is no problem, because the next morning, installation of a library, use the command CNPM install hexo – generator – search – save, after I baidu, some people say that is not ordered, because at that time, no progress has been the card and then cancelled, there may be, I feel CNPM uninstall hexo-generator-search –save. After using this command, I reported an error, too many of which were not saved.
wait until I use the heox d and the hexo g commands again, and I’m going to say the title is wrong
take a look at the picture:
the solution is to put the two packages in the next one:

see after the command is downloaded, the hexo g

if you have any problems, please leave a comment in the comments section

node.js Cannot find module “XXX” solution

Node. js can’t find a solution for the module XXX.
in order. 1. Check for spelling mistakes.
2. This module is written by myself. Check to see if the path is correct.
3. If it is the imported module. Use the NPM List command to output whether this module exists. 4. Also note that the global module installation directory defaults to users/ user /node_modules below. The module that your project is reading is your installation directory (and probably the two directories are different). So sometimes you don’t have this module, and after you install it, you continue to report that you can’t find the module
The solution is to output the path of your installation module with NPM, find the reading path of the current project, and copy the corresponding module to it

Node.js Cannot find module ‘mysql’ ‘express’

Not only ‘mysql’, but also ‘express’ Cannot find module.
When you use NodeJS, you inevitably refer to modules written by others, just as you must refer to third-party JARS when writing Java code.
At the time of reference, it can be obtained through NPM. At this time, if the location of execution command is not correct, it will cause the error of Cannot find Module ‘mysql’.
 
Different command locations will make the module installation location different, because there is no -g in the command, will be installed under the current path:
(Both 1 and 2 are in the wrong installation position, and the 3 bits are in the correct installation position. The reason is at the end.)
1. Execute command at any location: NPM install mysql-g. This module will appear in The directory C:\Users\SMouse\AppData\ NPM \ Node-Modules, as shown in the figure below
(Execute command)

(File location)

2. NPM install mysql in nodeJS installation directory. The ‘mysql’ module will be installed in the following node_modules

3. NPM install mysql in the project code, and the ‘mysql’ module will be installed in the following Node_modules (one will be automatically generated without this file).
(The following node_modules is where the modules are in my project. The rest of the files are code for various projects.)


mysql directory has a mysql. Js test code as follows:
var mysql = require(‘mysql’);

:
At first I thought I was going to put all the modules in nodejs in the node_modules directory. If the project code is on disk, it is ok, but if NodeJS is installed on disk D and the project code is on disk E, then the module is not referenced. C:\Users\SMouse\AppData\ NPM \ Node-Modules Path is the same.
The following three steps occur when a custom module (non-core module) is referenced in Node
1. Path analysis
2. File positioning
3. Compile and execute
The path analysis is carried out in the following way:
1) Node_modules in the current directory,
2) Node_modules in the parent directory;
3) Node_modules in the parent directory;
4) Recurse step by step until node_modules in the root directory.
If the module referenced in the code is not found in any of these directories, an error is reported: Cannot find Module ‘mysql’

— — — — — — — — — — — — — — — — — — — — —
the author: SMouse fish bones
source: CSDN
,
https://blog.csdn.net/fouglelove/article/details/52778021 copyright statement: this article original articles for bloggers, reproduced please attach link to blog!

Error: listen EADDRINUSE :::3000

1. Error description

events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::3000
    at Server.setupListenHandle [as _listen2] (net.js:1286:14)
    at listenInCluster (net.js:1334:12)
    at Server.listen (net.js:1421:7)
    at Object.<anonymous> (F:\Hworkspace\ES6\app.js:5:4)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
Emitted 'error' event at:
    at emitErrorNT (net.js:1313:8)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

2. Error reason
Since you are running node. js, port 3000 is already listening. If you run it again, an error will appear (it was not closed before).

const  http = require('http')
http.createServer((req,res) => {
	res.writeHead(200, { 'Content-Type': 'text/plain' });
	res.end("huhu");
}).listen(3000);

3. Solutions
Close the previous process first, and then rerun it