javascript-tutorial / server

Server for the Modern Javascript Tutorial
https://javascript.info
Other
450 stars 137 forks source link

error while installing local server #9

Closed aruzikulov closed 6 years ago

aruzikulov commented 6 years ago

Ubuntu 18.04, latest update, Node v8.11.3, npm v5.6.0 I followed all the steps carefully, and run 'npm install' and ./edit uz got this: $ npm install npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 npm WARN deprecated node-uuid@1.4.8: Use uuid module instead npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

dtrace-provider@0.8.7 install /home/ahmad/code/jsuz/javascript-tutorial-server/node_modules/dtrace-provider node-gyp rebuild || node suppress-error.js

make: Entering directory '/home/ahmad/code/jsuz/javascript-tutorial-server/node_modules/dtrace-provider/build' TOUCH Release/obj.target/DTraceProviderStub.stamp make: Leaving directory '/home/ahmad/code/jsuz/javascript-tutorial-server/node_modules/dtrace-provider/build'

nodemon@1.18.3 postinstall /home/ahmad/code/jsuz/javascript-tutorial-server/node_modules/nodemon node bin/postinstall || exit 0

npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1276 packages in 39.221s


$ ./edit uz

ahmad@matebook:~/code/jsuz/javascript-tutorial-server$ ./edit uz [10:22:25] Using gulpfile ~/code/jsuz/javascript-tutorial-server/gulpfile.js [10:22:25] Starting 'client:webpack'... [10:22:25] Starting 'tutorial:importWatch'... {"name":"tutorialImporter","hostname":"matebook","pid":24562,"level":30,"msg":"sync /home/ahmad/code/jsuz/javascript-tutorial-uz/1-js","time":"2018-07-21T02:22:26.156Z","v":0} {"name":"tutorialImporter","hostname":"matebook","pid":24562,"level":30,"msg":"syncFolder /home/ahmad/code/jsuz/javascript-tutorial-uz/1-js","time":"2018-07-21T02:22:26.157Z","v":0} [10:22:26] Starting 'client:sync-resources'... [10:22:26] Finished 'client:sync-resources' after 27 ms [10:22:26] Starting 'client:livereload'... [10:22:26] Starting 'server'... (node:24562) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead {"name":"tutorialImporter","hostname":"matebook","pid":24562,"level":30,"msg":"syncFolder /home/ahmad/code/jsuz/javascript-tutorial-uz/1-js/01-getting-started","time":"2018-07-21T02:22:26.302Z","v":0} {"name":"tutorialImporter","hostname":"matebook","pid":24562,"level":30,"msg":"syncArticle /home/ahmad/code/jsuz/javascript-tutorial-uz/1-js/01-getting-started/1-intro","time":"2018-07-21T02:22:26.304Z","v":0} {"name":"application","hostname":"matebook","pid":24562,"level":30,"msg":"Server is listening 0.0.0.0:3000","time":"2018-07-21T02:22:26.316Z","v":0} [10:22:26] Finished 'server' after 110 ms {"name":"tutorialImporter","hostname":"matebook","pid":24562,"level":30,"msg":"syncArticle /home/ahmad/code/jsuz/javascript-tutorial-uz/1-js/01-getting-started/2-code-editors","time":"2018-07-21T02:22:26.350Z","v":0} {"name":"tutorialImporter","hostname":"matebook","pid":24562,"level":30,"msg":"syncArticle /home/ahmad/code/jsuz/javascript-tutorial-uz/1-js/01-getting-started/3-devtools","time":"2018-07-21T02:22:26.355Z","v":0} {"name":"tutorialImporter","hostname":"matebook","pid":24562,"level":30,"msg":"syncFolder /home/ahmad/code/jsuz/javascript-tutorial-uz/1-js/02-first-steps","time":"2018-07-21T02:22:26.430Z","v":0} {"name":"tutorialImporter","hostname":"matebook","pid":24562,"level":30,"msg":"syncArticle /home/ahmad/code/jsuz/javascript-tutorial-uz/1-js/02-first-steps/01-hello-world","time":"2018-07-21T02:22:26.432Z","v":0} {"name":"tutorialImporter","hostname":"matebook","pid":24562,"level":30,"msg":"syncView: dir /home/ahmad/code/jsuz/javascript-tutorial-uz/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.view","time":"2018-07-21T02:22:26.439Z","v":0} [10:22:26] 'tutorial:importWatch' errored after 882 ms [10:22:26] TypeError: mime.lookup is not a function at /home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:579:21 at Array.filter () at readFs (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:570:17) at TutorialImporter.syncView (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:385:25) at TutorialImporter.syncTask (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:347:20) at Gulp error details [ 'mime.lookup is not a function', 'TypeError: mime.lookup is not a function\n at /home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:579:21\n at Array.filter ()\n at readFs (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:570:17)\n at TutorialImporter.syncView (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:385:25)\n at TutorialImporter.syncTask (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:347:20)\n at ' ] [10:22:29] livereload: listen on change public/pack/*/.,!public/pack/head.js [10:22:31] [webpack] Time: 5771ms Built at: 2018-07-21 10:22:31 Asset Size Chunks Chunk Names styles/blocks/font/icons.woff 14.6 KiB [emitted]
styles/blocks/font/icons.otf 22.6 KiB [emitted]
styles/blocks/page-footer/slack.svg 1.49 KiB [emitted]
styles.css 85.7 KiB 0 [emitted] styles styles.js 1.13 KiB 0 [emitted] styles head.js 18.3 KiB 1 [emitted] head tutorial.js 34 KiB 2 [emitted] tutorial footer.js 4.59 KiB 3 [emitted] footer Entrypoint styles = styles.css styles.js Entrypoint head = head.js Entrypoint tutorial = tutorial.js Entrypoint footer = footer.js Child mini-css-extract-plugin node_modules/css-loader/index.js??ref--9-1!node_modules/postcss-loader/lib/index.js??ref--9-2!modules/hover-loader.js!node_modules/stylus-loader/index.js??ref--9-4!tmp/styles.styl: Asset Size Chunks Chunk Names styles/blocks/font/icons.woff 14.6 KiB [emitted]
styles/blocks/font/icons.otf 22.6 KiB [emitted]
styles/blocks/page-footer/slack.svg 1.49 KiB [emitted]
Entrypoint mini-css-extract-plugin =
[10:22:31] Finished 'client:webpack' after 5.97 s


And I did: $ npm install mime npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

iliakan commented 6 years ago

Install latest node or at least latest npm : ‘npm up -g’, then reinstall modules

aruzikulov commented 6 years ago

upgraded node v.10.7.0 and npm v.6.1.0 TypeError: mime.lookup is not a function at /home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:579:21 at Array.filter () at readFs (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:570:17) at TutorialImporter.syncView (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:385:25) at TutorialImporter.syncTask (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:347:20) at Gulp error details [ 'mime.lookup is not a function', 'TypeError: mime.lookup is not a function\n at /home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:579:21\n at Array.filter ()\n at readFs (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:570:17)\n at TutorialImporter.syncView (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:385:25)\n at TutorialImporter.syncTask (/home/ahmad/code/jsuz/javascript-tutorial-server/handlers/tutorial/lib/tutorialImporter.js:347:20)\n at ' ] [21:10:50] livereload: listen on change public/pack/*/.*,!public/pack/head.js [21:10:54] [webpack] Time: 6344ms

aruzikulov commented 6 years ago

this fixed the problem, now working perfect as charm use mime-type instead of mime. So, Install mime-types first: npm install mime-types then make change in your code: const mime=require('mime-types');

source:https://stackoverflow.com/questions/46420905/webrtc-error-with-mime-lookup

iliakan commented 6 years ago

Should work with current mime.

iliakan commented 6 years ago

If we'll see that error again, I'll fix it =)