Situation
- download website data from Git Hub which is pushed 4 years ago from a different environment so taht update information and re-deploy.
- failed to
nuxt dev
because nuxt is not found.
How to solve errors
-
npm install
--> failed to install node-sass -
interpret error code to solve dependencies issues and change the version to appropriate one
npm install package_name@version
- node-sass require python@2 but @3 is set
- get python path using
which python2
- set python@2 in npm
npm config set python python2_path
- get python path using
- npm was downgraded to @8 for python@2
- nuxt was downgraded to @2
- sass-loader was downgraded to 10.0.2
- node-sass require python@2 but @3 is set
-
Node-sass install
-
after these version changes, run
npm audit fix
-
install modules required: vue-meta[^1] / vue-no-ssr / vue-router@3
- install required modules in according to errors
npm install module_name
--> module names will be on "dependencies" ofpackage.json
. - remove old modules and install content
rm -rf node_modules
-->rm package-lock.json
. - npm install
-->
node_modulesand
package-lock.json` (contents installed is recorded in this file) will be generated.
- install required modules in according to errors
*vue-meta installation help: https://github.com/nuxt/nuxt/issues/2535
*vue-router@3 installation help (vue-router@4 competed with vue@3): https://stackoverflow.com/questions/72444072/i-cant-install-vue-router-by-npm