L3-start cannot execute - weird crypto hash node module issue
Here are the steps I followed:
- git clone https://github.com/Code-Pop/Touring-Vue-Router.git
- npm install
- 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.
Node.js v18.12.1 ➜ Touring-Vue-Router git:(main) ✗ `
I have the same issue
use nvm to run it with node v.16
Ok it worked 😄 , thank you for helping.
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?
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.
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.
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).
@eharvey71
try removing node_modules and then git checkout package-lock.json, then npm install.