Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to downgrade npm 6.14.8 to be compatible w/ node 8.10 #27

Open
thesoulpole opened this issue Jan 19, 2022 · 3 comments
Open

how to downgrade npm 6.14.8 to be compatible w/ node 8.10 #27

thesoulpole opened this issue Jan 19, 2022 · 3 comments

Comments

@thesoulpole
Copy link

Hi, I upgraded (foolishly) npm from 5.6.0 (which I had from installing node 8.10, which I need for a software package) to 6.14.8.
Now it will not run, to downgrade. I get this: (even with version switch I get the same):

pi@raspberrypi:~/kettlerUSB2BLE $ npm install [email protected]
npm does not support Node.js v8.10.0
You should probably upgrade to a newer version of node as we
can't make any promises that npm will work with this version.
You can find the latest version at https://nodejs.org/
/opt/nodejs/lib/node_modules/npm/lib/npm.js:32
#unloaded = false
^

SyntaxError: Invalid or unexpected token
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at module.exports (/opt/nodejs/lib/node_modules/npm/lib/cli.js:22:15)

@si458
Copy link
Contributor

si458 commented Jan 19, 2022

you need to uninstall the current version first, then reinstall the old node

# This line will clear existing nodejs
sudo rm -rf /opt/nodejs;
# Remove existing symlinks
sudo unlink /usr/bin/node;
sudo unlink /usr/sbin/node;
sudo unlink /sbin/node;
sudo unlink /usr/local/bin/node;
sudo unlink /usr/bin/npm;
sudo unlink /usr/sbin/npm;
sudo unlink /sbin/npm;
sudo unlink /usr/local/bin/npm;
sudo unlink /usr/bin/npx;
sudo unlink /usr/sbin/npx;
sudo unlink /sbin/npx;
sudo unlink /usr/local/bin/npx;

@thesoulpole
Copy link
Author

so just installing the 8.10 version (using the command $ wget -O - https://raw.githubusercontent.com/sdesalas/node-pi-zero/master/install-node-v8.10.0.sh | bash) will not do it? I need to do the rm, unlinks first?

@si458
Copy link
Contributor

si458 commented Jan 19, 2022

so just installing the 8.10 version (using the command $ wget -O - https://raw.githubusercontent.com/sdesalas/node-pi-zero/master/install-node-v8.10.0.sh | bash) will not do it? I need to do the rm, unlinks first?

in theory the scripts already have the uninstall commands in them so you could just run the script again in theory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants