Update Node.js: Error while updating to stable version - node.js

trying to upadate node version.
Renter image description hereunning this sequence of commands.
1.npm cache clean -f
npm install -g n
after running the second command I am getting this error
$ npm install -g n
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n#9.0.0: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shara\AppData\Roaming\npm-cache_logs\2022-09-10T16_40_44_122Z-debug.log
Help would be greatly appreciated

https://nodejs.org/en/
If you visit this official node.js website, you can download the latest version depending on your operating system.
You will be able to successfully upgrade your node version this way

Related

Receiving an error when trying to install n

I'm getting the following error when trying to install n, after getting a previous error saying that I need to upgrade my node to run npm commands.
The error is as follows:
PS C:\new-project> npm install -g n
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n#7.3.0: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
Npm version
PS C:\new-project> npm -v
6.9.0
Node version
PS C:\new-project> node -v
v12.5.0
It's because the nvm project is only for linux and macos, and cannot be installed in windows.
But there is an alternative which is not clone but recommend nodejs version manager. Here is the link

My npm is not compatible with the package.json after switching to Linux?

I recently switched to Pop! OS Linux on my macbook pro 11,1 (2013) and upon trying to clone into my github repo and install the npm packages, I receive this error:
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion#1, but package-lock.json was generated for lockfileVersion#2. I'll try to do my best with it!
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents#2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: linux
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR! /home/danielvillegas/.npm/_logs/2021-05-25T01_48_00_584Z-debug.log
I did install the latest version of npm onto the new system which is currently
$ npm --version // 6.14.8.
So it seems like I was able to fix the problem by deleting the package-lock.json and then reinstalling with npm install. But... Is there a way I can avoid this issue in the future? I'm not sure what the root of it is.

"npm install -g n" then Error: npm ERR! code EBADPLATFORM

My aim is to update Node.js to the latest.
I followed the instructions on this page.
I got the error when executing npm install -g n:
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n#6.7.0: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
I don't know what that means.
You can still install newest/needed version of Node.js on Windows by downloading it from: https://nodejs.org/en/download/

Failing to npm install socket.io, notsup Unsupported platform for fsevents#1.1.3

Trying to "npm install socket.io" on a Ubuntu EC2 instance and getting this error. Does this mean I cannot use Ubuntu? Or is there a way to fix this?
$ npm install socket.io
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: linux
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2018-03-15T00_57_15_115Z-debug.log
$ node --version
v8.9.4
$ npm --version
5.7.1
Here is the debug log it referred to:
https://gist.github.com/lampshade9909/57c631be80a75c1675c315de05e51747
It seems that I may need to install an older version of node. I'm trying 6.10 and it installed.
I am on Ubuntu and get that error all the time. I believe fsevents#1.1.3 is for OS x . Linux system ignores fsevents whereas mac will install it.

How to solve "Unsupported platform for inotify#1.4.2"

**npm ERR!** code EBADPLATFORM
**npm ERR!** notsup Unsupported platform for inotify#1.4.2: wanted {"os":"linux","arch":"any"} (current: {"os":"darwin","arch":"x64"})
**npm ERR!** notsup Valid OS: linux
**npm ERR!** notsup Valid Arch: any
**npm ERR!** notsup Actual OS: darwin
**npm ERR!** notsup Actual Arch: x64
This is possibly due to the dev package which gets installed with npm and this problem generally occurs with Mac OS.
Run the below command to remove the dev package.
npm uninstall dev --save
I hope I'm able to help with this answer.
I got the same error using nom, but I tried with Yarn, it worked.
$ npm i dev jest
npm WARN deprecated istanbul-lib-hook#1.2.1: 1.2.0 should have been a major version bump
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for inotify#1.4.2: wanted {"os":"linux","arch":"any"} (current: {"os":"darwin","arch":"x64"})
npm ERR! notsup Valid OS: linux
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: darwin
npm ERR! notsup Actual Arch: x64
But then I tried with yarn
$ yarn add --dev jest
This might not have fix the problem with npm but it fixed this error for me
Below command worked for me.
sudo npm -g uninstall dev --save
More details on uninstalling npm package can be found here : How to uninstall npm modules in node js?

Resources