Touring-Vue-Router icon indicating copy to clipboard operation
Touring-Vue-Router copied to clipboard

L3-start cannot execute - weird crypto hash node module issue

Open r00tmeister opened this issue 2 years ago • 8 comments

Here are the steps I followed:

  1. git clone https://github.com/Code-Pop/Touring-Vue-Router.git
  2. npm install
  3. npm run serve

` Touring-Vue-Router git:(main) ✗ npm run serve

[email protected] serve vue-cli-service serve

INFO Starting development server... 10% building 2/2 modules 0 active(node:35386) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated. (Use node --trace-deprecation ... to show where the warning was created) 10% building 2/4 modules 2 active /Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/webpack/hot/dev-server.jsnode:internal/crypto/hash:71 this[kHandle] = new _Hash(algorithm, xofLen); ^

Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at module.exports (/Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/webpack/lib/util/createHash.js:135:53) at NormalModule._initBuildHash (/Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/webpack/lib/NormalModule.js:417:16) at handleParseError (/Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/webpack/lib/NormalModule.js:471:10) at /Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/webpack/lib/NormalModule.js:503:5 at /Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/webpack/lib/NormalModule.js:358:12 at /Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/loader-runner/lib/LoaderRunner.js:373:3 at iterateNormalLoaders (/Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/loader-runner/lib/LoaderRunner.js:214:10) at Array. (/Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/loader-runner/lib/LoaderRunner.js:205:4) at Storage.finished (/Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16) at /Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9 at /Users/r00tmeister/vueMastery/Touring-Vue-Router/node_modules/graceful-fs/graceful-fs.js:123:16 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }

Node.js v18.12.1 ➜ Touring-Vue-Router git:(main) ✗ `

r00tmeister avatar Jan 24 '23 08:01 r00tmeister

I have the same issue

Kacperacy avatar Feb 26 '23 22:02 Kacperacy

use nvm to run it with node v.16

tutorialcode avatar Feb 26 '23 22:02 tutorialcode

Ok it worked 😄 , thank you for helping.

Kacperacy avatar Feb 26 '23 22:02 Kacperacy

Shouldn't the developer fix the code to work with the latest version of Node? Why do I (as a paying customer at Vue Mastery) have to deal with old Node and 3-year old example code that isn't being maintained?

eharvey71 avatar Mar 21 '23 19:03 eharvey71

I used NVM to get to node 16 and I'm still having this issue:

INFO Starting development server...

ERROR Failed to compile with 1 error 3:18:53 PM

error in ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=css

Syntax Error: Error: PostCSS plugin autoprefixer requires PostCSS 8. Migration guide for end-users: https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users

ERROR in ./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=css (./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/App.vue?vue&type=style&index=0&id=7ba5bd90&lang=css) Module build failed (from ./node_modules/postcss-loader/dist/cjs.js): Error: PostCSS plugin autoprefixer requires PostCSS 8.

eharvey71 avatar Mar 21 '23 19:03 eharvey71

Shouldn't the developer fix the code to work with the latest version of Node? Why do I (as a paying customer at Vue Mastery) have to deal with old Node and 3-year old example code that isn't being maintained?

Yes, they can enforce the user installs the correct node version for the project by adding an engines field to the package.json file :

"engines": { "node": "16.x" },

Adding the "engines" field to your package.json file will help ensure that your project is running on the correct version of Node.js. This can be important for a few reasons:

Compatibility: Different versions of Node.js have different features and capabilities. If your project relies on certain features that are only available in a specific version of Node.js, specifying the required version in the package.json file will help ensure that your project runs correctly and without compatibility issues.

Security: Each version of Node.js has its own set of security vulnerabilities. Some vulnerabilities may affect only specific versions, while others may affect all versions. By specifying the required version of Node.js in the package.json file, you can ensure that your project is not exposed to known vulnerabilities that have been patched in newer versions of Node.js.

Reliability: Using the correct version of Node.js can help improve the stability and reliability of your project. If your project was developed and tested using a specific version of Node.js, it may not function correctly or consistently on other versions. Specifying the required version in the package.json file can help ensure that everyone working on the project is using the same version, which can reduce the risk of issues and improve the overall reliability of the project.

r00tmeister avatar Mar 21 '23 19:03 r00tmeister

Shouldn't the developer fix the code to work with the latest version of Node? Why do I (as a paying customer at Vue Mastery) have to deal with old Node and 3-year old example code that isn't being maintained?

Yes, they can enforce the user installs the correct node version for the project by adding an engines field to the package.json file :

"engines": { "node": "16.x" },

Adding the "engines" field to your package.json file will help ensure that your project is running on the correct version of Node.js. This can be important for a few reasons:

Compatibility: Different versions of Node.js have different features and capabilities. If your project relies on certain features that are only available in a specific version of Node.js, specifying the required version in the package.json file will help ensure that your project runs correctly and without compatibility issues.

Security: Each version of Node.js has its own set of security vulnerabilities. Some vulnerabilities may affect only specific versions, while others may affect all versions. By specifying the required version of Node.js in the package.json file, you can ensure that your project is not exposed to known vulnerabilities that have been patched in newer versions of Node.js.

Reliability: Using the correct version of Node.js can help improve the stability and reliability of your project. If your project was developed and tested using a specific version of Node.js, it may not function correctly or consistently on other versions. Specifying the required version in the package.json file can help ensure that everyone working on the project is using the same version, which can reduce the risk of issues and improve the overall reliability of the project.

Specifying the required version of Node.js in your package.json file will work even if you have a newer version of Node.js (such as version 18) installed on your computer.

When you run a Node.js project, the version of Node.js that is used is determined by the version specified in the engines field of the package.json file, not by the version that is currently installed on your computer. This means that even if you have Node.js version 18 installed on your computer, if the engines field specifies version 16, the project will run using version 16 (assuming version 16 is also installed on your computer).

r00tmeister avatar Mar 21 '23 19:03 r00tmeister

@eharvey71 try removing node_modules and then git checkout package-lock.json, then npm install.

tutorialcode avatar Mar 27 '23 17:03 tutorialcode