Tag : node.js

The front-end encapsulates the FormData object post to the back-end nodejs. nodejs uses formidable to parse the request. Up to this point, there has been no problem. nodejs can successfully parse the request and print out the desired data. However, I wanted to send the data obtained after parsing the request to the python server ..

Read more

What does this mistake mean and how to solve it? Also please master advice: Last login: Sun Oct 16 10:11:50 on ttys000DerekdeMacBook-Pro:~ derek$ npm -v2.15.9DerekdeMacBook-Pro:~ derek$ npm install webpack -gnpm ERR! tar.unpack untar error /Users/derek/.npm/webpack/1.13.2/package.tgznpm ERR! Darwin 15.3.0npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “webpack” “-g”npm ERR! node v4.6.0npm ERR! npm v2.15.9npm ERR! path /usr/local/lib/node_modules/webpacknpm ERR! ..

Read more

Js code var http = require(“http”), fs = require(“fs”), querystring = require(“querystring”), url = require(“url”); http.createServer(function(req,res){ var postdata=””; var query=”what”; var pathname = url.parse(req.url).pathname; req.setEncoding(“utf8″); if(pathname==”/”){ Var indexPage = fs.readFileSync (“form.html”); res.writeHead(200,{“Content-Type”:”text/html”}); res.end(indexPage); bracket if(pathname==”/about”){ req.on(“data”,function(chunk){ Postdataplus = chunk; }); req.on(“end”,function() { console.log(postdata); query = querystring.parse(postdata); console.log(query); }); res.writeHead(200, {“Content-Type”:”text/plain”}); console.log(query.Name); console.log(query.number); Res.write(query.number plus “and” ..

Read more

I found it on github and said it could be used.node-rtsp-streamTo transcode the video stream,According tohttps://www.npmjs.com/package …It’s written on,Inpm install node-rtsp-streamLater, execute on node Stream = require(‘node-rtsp-stream’); stream = new Stream({ name: ‘name’, streamUrl: ‘rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov’, wsPort: 9999 }); After that, it was written in js inside. client = new Websocket(‘ws://localhost:9999’); player = new jsmpeg(client, { ..

Read more

I found all kinds of information on the internet and installed all kinds of bags mentioned by netizens, but it just couldn’t solve the problem. Front end code $.ajax({ url:’/pass/uploadexcel’, type:’POST’, dataType:’json’, data:data, contentType:false, success:this.uploadSuccess, processData: false, error:this.uploadError }); In this way, I submitted formdata data (just a file) to Nodejs at the back end, ..

Read more

Nodejs is required to operate the picture, mainly including: Crop compression even obtains pixel values of all pixels of the picture, etc. … If you look for it online, there are many, but I don’t know how to use it. I don’t know if there is any better picture library. Or is native writing better? ..

Read more

Js code: function A(x){ this.x = x ; bracket function B(y) { this.y = y; bracket B.prototype = new A(1); function C(z) { this.z = z; bracket var b = new B(2); C.prototype = new B(2); console.log(b); console.log(C.prototype); console.log(b instanceof A); console.log(C.prototype instanceof A); console.log(b.constructor); console.log(C.prototype.constructor); Print results: As shown in the figure: b and ..

Read more

this is Error: ERROR in ./app/main.jsx Module parse failed: /home/liudong/Public/proj/Homepage/app/main.jsx Unexpected token (8:7) You may need an appropriate loader to handle this file type. SyntaxError: Unexpected token (8:7) at Parser.pp$4.raise (/home/liudong/Public/proj/Homepage/node_modules/acorn/dist/acorn.js:2221:15) at Parser.pp.unexpected (/home/liudong/Public/proj/Homepage/node_modules/acorn/dist/acorn.js:603:10) at Parser.pp$3.parseExprAtom (/home/liudong/Public/proj/Homepage/node_modules/acorn/dist/acorn.js:1822:12) Json “dependencies”: { “react”: “^15.4.0-rc.4”, “react-dom”: “^15.4.0-rc.4”, “react-router”: “^2.8.1” }, “devDependencies”: { “babel-core”: “^6.17.0”, “babel-loader”: “^6.2.5”, “babel-preset-es2015”: “^6.16.0”, ..

Read more