When using the webpack build file project, a dist directory is generated every time. Sometimes, all the old files in the dist directory need to be deleted,
In addition to the RM – RF / dist / command, you can also use the rimraf / dist / command
The function of rimraf is to package the RM - RF command in the form of package to delete files and folders, regardless of whether the folder is empty or not
An error is as follows checked online related: . because package json file does not have to configure the build script, so the above error!
Solutions:
1. Add build script to scripts in package.json:
“NODE_ENV” : user-defined environment variable webpack “: integrated packaging command “>config” : config file “webpa>onfig.js” : config file, which is a Node. js module that returns a JSIN-formatted configuration information object, or the –config option to specify the configuration file
It is possible that ‘cross-env’ is not an internal or external command and is not a executable program can be resolved by NPM I –save-dev cross-env.
The results of
Execute NPM run build, and the results will appear in the dist folder. Successful packaging!
Reference: https://www.cnblogs.com/tugenhua0707/p/9780621.html
Perform the following query in MYSQL Workbench ALTER USER ‘root’ @’ localhost ‘IDENTIFIED WITH mysql_native_password BY’ password ‘ when root is USER localhost of your url, and password is your password , then run the following query to flush privileges: flush privileges; try using node connections after completion. if that doesn’t work, try @’ localhost ‘
Assume that this is a url http://localhost:8080/a/b/c?a=1& protocol: ‘HTTP:’,// protocol host: ‘localhost:8080’, port: ‘8080’,// port hostname: ‘localhost’, domain hash: ‘#abcd’, search: ‘?a=1& B = 2 ‘, query: ‘a = 1 & amp; B =2 ‘, pathname: ‘/a/b/c’, path: ‘/a/b/c?a=1& B = 2 ‘, href: ‘http://localhost:8080/a/b/c?a=1& B = 2 # ABC ‘
Url.parse () can break a complete URL into many parts, such as host, port, Pathname, path, and Query
var http = require("http");
var url = require("url");
var server = http.createServer(function(req,res){
var pathname = url.parse(req.url).pathname;
var query = url.parse(req.url).query;
console.log("patname:"+ pathname);
console.log(query);
res.end();
});
server.listen(80,"127.0.0.1");
NVM is installed under ~/. NVM is not installed with the previous one. I am a little obsessive, so I want to uninstall the previous one
Homebrew installed
brew uninstall node
The official website downloads the PKG installation package
A command sudo rm - rf/usr/local/{bin/{node, NPM}, lib/node_modules/NPM, lib/node, share/man/*/node. *} code>
It was installed in another way
Make a script, the need to delete the file, a shuttle all kill
It will be called: uninstallNode. sh
Modify file permissions chmod 777 uninstallnodejs.sh is executed on the command line
When you're done deleting all that stuff, you're done deleting node. but there are a lot of node-based installed software and command-line tools that need to be reinstalled, such as react-native, supervisor,pm2 etc need to delete the files under /usr/local/bin, actually they are just soft connections, it's all under /usr/local/lib/node_modules/. was removed in the previous step, but you can still find it by pressing the TAB key because these soft connections still exist
Look at the picture first:
The main reason for this problem is that the files you are uploading are not in the same folder
So put the folder TMP and the running JS files in the same directory, as shown in the figure below:
Then the path is changed. The first path I wrote was fs.readfile (“/ TMP /test.png”…) There is no problem changing “/ TMP /test.png” to “./ TMP /test.png”
Fs. ReadFile (“./TMP/test. The PNG “, “binary”, function (the error, the file) { if (error) { response. WriteHead (500, {” content-type “:” text/plain “}); response. Write (error + “\ n”); the response. The end (); } else { response. WriteHead (200, {” content-type “:” image/PNG} “); response. Write (file, “binary”); the response. The end ();
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)
(node:57300) UnhandledPromiseRejectionWarning: Error: Can't set headers after they are sent.
at validateHeader (_http_outgoing.js:491:11)
at ServerResponse.setHeader (_http_outgoing.js:498:3)
In the Node project, you encountered this error while doing module splitting.
is checked to be package.json deleted
These three modules cause these three modules not to be deleted.
is originally required by the server to render the json inside the reference file is relative. Node_modules relative to the root directory, so the items below the root directory are related to modules such as vue, Babel-Polyfill, etc.
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.
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
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