Tag Archives: node

Solve the problem of Too many levels of symbolic links

Too many levels of symbolic links when using ln to create soft links

root@instance-vgiv786y:/opt/jdk1.8.0_181/bin# ln-s Java /usr/local/bin/ Java

change to:
root @instancevgiv786y :/opt/jdk1.8.0_181/bin# ln-s /opt/jdk1.8.0_181/bin/ Java /usr/local/bin/ Java
Obviously I’m installing the JDK, but why would I want to create this soft connection?Just add the environment variable at /etc/profile. However, when I connected this server as one of Jenkins’ nodes, I was surprised to find that Java could not be found. Obviously, I added the environment variable and it took effect. Jenkins had to look under various bin directory, so I created this soft connection.

VUEJS Failed to execute ‘removeChild’ on ‘Node’: The node to be removed is not a child of

Failed to execute ‘removeChild’ on ‘Node’ : The Node to be removed is not a child of this Node.

in my previous post
VUEJS project practice 5 Dialog pop-up box MessageBox (very nice bootstrap style)
has introduced a MesageBox style combined with bootstrap style
Then in the previous post
VUEJS project practice 4 custom keyboard instructions (keystrokes to get focus)
introduced a way for keystrokes to automatically get focus and trigger events.
Now when MessageBox binds Enter, an error
messagebox.vue?Cb02 :80 Uncaught DOMException: Failed to execute ‘removeChild’ on ‘Node’ : The Node to be removed is not a child of this Node.

First post the message.vue file

<template>
  <div v-key-bind-listen>
      <div class="msgBox" v-show="isShowMessageBox">
        <div class="msgBox_header">
          <div class="msgBox_title">
            <h3>{{ title }}</h3>
          </div>
        </div>

        <div class="msgBox_content">
          <p>{{ content }}</p>
        </div>

        <div class="msgBox_btns">
          <button type="button" class="btn btn-lime btn-lg" id="confirmBtn" @click="confirm"  bind_key="ENTER">确定</button>
          <button type="button" class="btn btn-dark btn-lg" id="cancelBtn" @click="cancel"  bind_key="ESC">取消</button>

        </div>

      </div>
  </div>
</template>

<script>
  export default {
    name: 'messageBox',
    data(){
      return {
        title: '',
        content: '',
        isShowMessageBox: false,
        resolve: '',
        reject: '',
        promise: '' // 保存promise对象
      }
    },
    methods: {
      close(state){
        this.model.show = false;
        if(this.model.callback){
          this.model.callback(state);
        }
      },
    // 确定,将promise断定为resolve状态
    confirm: function () {
      this.isShowMessageBox = false;
      this.resolve('confirm');
      this.remove();
    },
    // 取消,将promise断定为reject状态
    cancel: function () {
      this.isShowMessageBox = false;
      this.reject('cancel');
      this.remove();
    },
    // 弹出messageBox,并创建promise对象
    showMsgBox: function () {
      this.isShowMessageBox = true;
      this.promise = new Promise((resolve, reject) => {
        this.resolve = resolve;
        this.reject = reject;
      });
      // 返回promise对象
      return this.promise;
    },
    remove: function () {
      setTimeout(() => {
        this.destroy();
      }, 300);
    },
    destroy: function () {
      this.$destroy();
      document.body.removeChild(this.$el);
    }
  }
  }
</script>

<style scoped>
  .msgBox {
    position: fixed;
    z-index: 4;
    left: 50%;
    top: 35%;
    transform: translateX(-50%);
    width: 420px;
    background-color: black;
    opacity: 0.55;
  }

  .msgBox_header {
    padding: 20px 20px 0;
  }

  .msgBox_title {
    padding-left: 0;
    margin-bottom: 0;
    font-size: 26px;
    font-weight: 800;
    height: 18px;
    color: #fff;
  }

  .msgBox_content {
    padding: 30px 20px;
    color: #fff;
    font-size: 18px;
    font-weight: 200;
  }

  .msgBox_btns {
    padding: 10px 20px 15px;
    text-align: right;
    overflow: hidden;
  }

  @keyframes show-messageBox {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;

    }
  }

  @keyframes bounce-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;

    }
  }


</style>

The V-key-bind-listen instruction defined here is used for key listening. For details, please refer to the previous blog. It would be boring to write it again.
VUEJS project practice four custom keyboard commands (keys to get focus)
When you press ESC to cancel, there is no problem
when you press ENTER to confirm, the error will appear in the newspaper
messagebox.vue?Cb02:80 Uncaught DOMException: Failed to execute ‘removeChild’ on ‘Node’ : The Node to be removed is not a child of this Node.
Error is located via console.

>
add a line of logs in the destroy method. The console prints this.$el.

console.log(this.$el)

Add a line of logs to determine if this.$el is a child of the body

console.log(document.body.contains(this.$el))

MongoNetworkError: failed to connect to server [localhost:27017]

MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connection 0 to localhost:27017 timed out
    at Socket.<anonymous> (D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\connection.js:355:7)     
    at Object.onceWrapper (events.js:427:28)
    at Socket.emit (events.js:321:20)
    at Socket._onTimeout (net.js:478:8)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7) {
  name: 'MongoNetworkError'
}]
    at Pool.<anonymous> (D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\topologies\server.js:438:11)
    at Pool.emit (events.js:321:20)
    at D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\pool.js:562:14
    at D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\pool.js:995:11
    at callback (D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\connect.js:97:5)
    at D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\connect.js:124:7
    at _callback (D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\connect.js:349:5)
    at Connection.errorHandler (D:\Desktop\node\mongodblearn\07_student_list\node_modules\mongodb\lib\core\connection\connect.js:365:5)   
    at Object.onceWrapper (events.js:428:26)
    at Connection.emit (events.js:321:20) {
  name: 'MongoNetworkError'
}

The above error indicates that Mongodb is not started

Ineffective mark-compacts near heap limit Allocation failed – JavaScript heap out of memory

1. problem description.
At present, when compressing the front-end code, there are memory leaks in the nodes, errors as follows: invalid marker – collating nearby heap limit allocation failure – JavaScript heap memory
2. The errors are as follows.

Warning: callback based version of packager() has been deprecated and will be removed from future major releases, please convert to committed version or use nodeify module.
Packager application for win32 ia32 platform, using ev4.0.5
—last few times–>
ms: Mark-sweep 1294.7 (1425.0) -> 1294.7 (1425.5) MB, 1723.7/0.0 ms (average mu = 0.094, current mu = 0.000) last resort GC requests for old space
[23328:00000202C8E3E9D0] 11281890 ms: marker scan 1295.7 (1425.5)->1294.7 (1426.5) MB, 1734.9/0.0 ms (average mu = 0.101, current mu = 0.108) assignment failure clearance may not be successful

<- JS stacktrace ->

0: ExitFrame [pc: 000003C6B7315600]
Security context: 0x01457ba9e6e1 <JSObject>
1: access [0000031C1EB050F9] [fs]js: ~ 167] [pc = 000003 c6b7319b09] (= 0 x01dd68b04d69 & lt;object mapping = 00000232 d8c16af9>, = 0 x00b368108379 & lt;path string[737]:E: \pacs-consultation-electron-meeting \ node_modules \ stompjs \ node_modules \ websocket \\ node_modules \ es5-ext \ node_modules \ es6-iterator \ node_modules \ d\ node_modules \ es5-ext \ node_modules \ es6-iterator \ node_modules \ es6-iterator \ node_modules \ es6-iterator node__……
Fatal error: Invalid marker – failed collation nearby heap limit allocation – JavaScript heap memory
1: 00007 ff67be308aa v8: Internal:GCIdleTimeHandler: GCIdleTimeHandler + 4810
2: 00007 ff67be09c46 node:MakeCallback + 4518
3: 00007 ff67be0a630 node_module_register + 2160
4: 00007 ff67c09aa4e v8: Internal:FatalProcessOutOfMemory + 846
5: 00007 ff67c09a97f v8:Internal:FatalProcessOutOfMemory + 639
6: 00007 ff67c5d8984 v8:internal:heap:MaxHeapGrowingFactor + 11476
7:00007 ff67c5cf0e7 v8::internal::ScavengeJob::operator= + 25543
8: 00007 ff67c5cd65c v8:Internal:ScavengeJob::operator= + 18748
9: 00007 ff67c5d65d7 v8:Internal:Heap:MaxHeapGrowingFactor + 2343
10: 00007 ff67c5d6656 v8:Internal:Heap:MaxHeapGrowingFactor + 2470
11: 00007 ff67c1790db v8:Internal::Factory::AllocateRawWithImmortalMap + 59
12: 00007 ff67c17ba9d v8:Internal::Factory::NewRawOneByteString + 77
13: 00007 ff67c38fbc4 v8: Internal:Heavy:SmiPrint + 372
14:00007FF67C08DF5B v8::internal::StringHasher::UpdateIndex+219
15: 00007FF67C0B44CB v8::WriteUtf8+171
16: 00007FF67BD3F1A0 std::basic_ostream<:operator< +40912
17: 00007FF67BDC9B92 uv_loop_fork+13762
18: 000003c6b7315600
npm ERR!Code ELIFECYCLE
npm ERR!er!pac – electronic [email protected] build:win32: ‘ cross-env BUILD_TARGET=win32 node .electron-vue/build. js ‘
npm made a mistake! Exit Status 134
npm ERR!
npm ERR! In pac – electronic [email protected]构建:win32脚本中失败.
npm made an error! This may not be a problem with npm. There may be additional log output above.
npm made an error! The full log of this run can be found in the following file:
npm ERR!C:\Users\boyi08\AppData\Roaming\npm-cache\_logs\ 2020 – 02 – 25 – t04_43_09_617z debug.log
3. Solutions
Programme I.
In the package. inside the json: add this sentence:–max_old_space_size = 8192 // or max_old_space_size = 4096 (it is recommended to set to 4 g to see, if not set to 8 g)
“script”: {
“dev”: “node build/dev-server.” “start”: “node build/dev-server.” node -max_old_space_size=8192 build/build”.
“build”: “node -max_old_space_size=8192 build/build. js ”
},
Programme 2.
Delete the npmrc file (not the npmrc file in the nodejs installation directory under the npm module, but the .npmrc file in C: \\user\{account}\).

NPM warn optional skipping optional dependency: 1 [email protected] (node_ modules\fsevents):

when executing NPM install may report the following error:

NPM WARN optional Tours DEPENDENCY: fsevents@node_modules \fsevents> :
NPM WARN notsup Tours optional Tours DEPENDENCY: Unsupported platform for [email protected]: wanted {“os”:”darwin”,”arch”:”any”} (current: {“os”:”win32″,”arch”:”x64″})

query found that fsevent is MAC system, used in win or Linux, so there will be a warning, ignore it. The function of FSEvent is to detect the change of file directory, can record the illegal operation of the malware, obtain the full path of the malware, delete and modify date.

Debugging with chrome Node.js

sharpen the knife not by mistake woodcutters, good tools will let us debug a lot of convenience and fast.

in November 2019, Google Chrome 78 release. Js (which may have been available in earlier versions, but I didn’t)

The

entry is next to the familiar “element selection tool” and “device emulator” in the developer tools:

is also easy to use. Click the button, devtools-node. js will pop up, as shown in the figure below:


can Add connection by Add connection button, and create a new port listening, here I Add localhost:9999 (as shown below). You can also modify and delete existing links.



everything is ready to start debugging. debugger where you need to debug in NodeJs code. Then execute the command node --inspect=port your_script, for example:

node --inspect=9999 message_list

if we run into an error like , inspector on 127.0.0.1:9229 failed: address already in use try changing the port number.

all normal will automatically enter debugging mode:

Cannot find module ‘internal / util / types’ appears during gulp build

when I was compiling the compressed file with gulp build, which had always been easy to use before, I ran this error out of nowhere. Because it had been easy to use before, it suddenly became difficult to use, so I wondered if there was something wrong with the code. cannot find module. If you install NPM install XXXXX –save-dev, you will be able to solve the problem.

, I searched again and found that someone said that de-versioning could be solved, so I tried to reduce node’s version from v10 to V8 first, but the problem still existed, then from V8 to v6, and executed again, but found that this was the case. It depends on the version of Node. (If you want to use the latest version of Node, you need to upgrade gulp to the response version as well. You need to uninstall Gulp first and then re-install the new version of Gulp. During the process, a series of error prompts of The Cannot Find Module will appear. It is only necessary to install these missing modules once.

G:\chenqk\app\HAM-Front>gulp build
module.js:549
    throw err;
    ^

Error: Cannot find module 'internal/util/types'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at evalmachine.<anonymous>:31:26
    at Object.<anonymous> (G:\chenqk\app\HAM-Front\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:11:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

G:\chenqk\app\HAM-Front>npm install internal/util/types --save-dev
npm ERR! code ENOLOCAL
npm ERR! Could not install from "internal\util\types" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\chenqk\AppData\Roaming\npm-cache\_logs\2019-05-23T02_39_55_270Z-debug.log

After the

downgrade, gulp build

is executed again

G:\chenqk\app\HAM-Front>gulp build
(node:16816) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[11:01:45] Using gulpfile G:\chenqk\app\HAM-Front\gulpfile.js
[11:01:45] Starting 'build'...
[11:01:45] Starting 'clean'...
[11:01:45] Finished 'build' after 209 ms
[11:01:45] Finished 'clean' after 235 ms
[11:01:45] Starting 'script-build'...
[11:01:52] Finished 'script-build' after 6.8 s
[11:01:52] Starting 'css-build'...
[11:01:52] Finished 'css-build' after 198 ms

there are different versions of Nodejs. There is a need to be able to download (now resources when the default of five points, no points and want to, you can leave a message, sent in the past)

https://download.csdn.net/download/chenqk_123/11195134

Get synchronization retrieved hash chain is invalid error

error message:

########## BAD BLOCK #########
Chain config: {ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: 7280000 Petersburg: 7280000 Istanbul: 9069000, Muir Glacier: 9200000, Engine: ethash}

Number: 9069000
Hash: 0x072cf1df374159c5f23087750d8a2f3201542da196939ce446ff2c5c390fe5f6
·································································
·································································
·································································
·································································
·································································
Error: invalid gas used (remote: 6395997 local: 6449093)
##############################
 
WARN [12-10|12:01:11.813] Synchronisation failed, dropping peer    peer=106a4c4cba9167bf err="retrieved hash chain is invalid"

environment

Geth
Version: 1.9.7
Architecture: amd64
Protocol Versions: [64 63]
Go Version: go1.13.1
Operating System: Linux

cause:

ethereum update 2.0, starting with block 9069000, found on github that this error

occurs with version 1.9.8 1.9.7

scheme:

updates geth to version 1.9.9. The following provides an update method

centos7 environment

  1. select the latest version to download geth download address
wget -c https://github.com/ethereum/go-ethereum/archive/v1.9.9.zip
  1. download good, unzip (no unzip download a unzip)
unzip v1.9.9.zip
  1. then enter the directory, make geth
cd go-ethereum-1.9.9 
make geth
  1. if make geth for a long time no response, probably is the problem of the network, add a proxy, command line input:

export GOPROXY=https://goproxy.cn

  1. and then re-make geth is ok.

  2. after loading, check the version of geth. If it is still the original version, delete the original geth command

    export PATH=$PATH:~/go-ethereum-1.9.9/build/bin/
    $PATH:

    for your geth command

    vim  /etc/profile
    
    1. and then refresh
    source /etc/profile
    

    check the next version should be ok

    and then back on track, pull block

gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildPr

骗取犯错!建立错误
gyp ERR!堆栈错误:make failed with exit code: 2
gyp ERR!在ChildProcess堆栈。onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR!在ChildProcess堆栈。emit (events.js:182:13)
gyp ERR!在Process.ChildProcess._handle堆栈。onexit (internal/child_process.js:239:12)
gyp ERR达尔文系统16.7.0
gyp ERR!命令“/ usr /地方/地窖/节点/ 10.9.0/bin /节点”“/ usr /地方/ lib/node_modules/npm node_modules/node-gyp/bin/node-gyp。js ” “重建” gyp ERR!cwd /Users/zhangying/Documents/www/kurento/kurento-client-js/node_modules/utf-8-validate gyp ERR!node-gyp -v v3.8.0
不ok
npm WARN [email protected]需要一个对等的grunt@~0.4.1,但没有安装。您必须自己安装对等依赖。

npm犯错!代码ELIFECYCLE
npm ERR!ERR!
npm [email protected]安装:node-gyp rebuild
npm ERR!退出状态1
npm ERR!
npm犯错!安装脚本[email protected]失败。
npm犯错!这可能不是npm的问题。上面可能有额外的日志输出

npm犯错!此运行的完整日志可在以下文件中找到:
npm ERR!/用户/ zhangying/.npm/_logs/2018 – 09 – 08 – t03_07_51_380z debug.log

方法一:
npm安装- g bcrypt
方法二:
删除~ /。node-gyp
方法三:
切换到当前项目下即可。

rm射频.node-gyp/

npm install -g node-gyp

rm射频项目/ node_modules

再次,npm安装即可。