NPM install netlift cli not working

Trying to update our netlify instance, we currently use this to install netlify which works perfectly:

* apt-get update -y	            
* apt-get install -y jq wget	
* wget -qO- "https://github.com/netlify/netlifyctl/releases/download/v0.4.0/netlifyctl-linux-amd64-0.4.0.tar.gz" | tar -xz

I tried switching the commands to this npm install netlify-cli -g but it doesnt seem to work and it returns this error:

npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

npm WARN deprecated statsd-client@0.4.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated

npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

added 1316 packages, and audited 1317 packages in 16s

154 packages are looking for funding

run `npm fund` for details

17 vulnerabilities (10 moderate, 7 high)

To address issues that do not require attention, run:

npm audit fix

To address all issues possible (including breaking changes), run:

npm audit fix --force

Some issues need review, and may require choosing

a different dependency.

Run `npm audit` for details.

Any help would be greatly appreacited, currently the node version is v16.17.1 and npm version is 8.15.0

Hello @chebas, sorry you are having trouble installing Netlify CLI

Kindly try the following below to see if it helps resolve the issue.

  • Remove your current version of npm and node.js
    You can use
sudo apt-get remove nodejs
sudo apt-get remove npm
  • Install nvm (Node Version Manager) using the command below.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

  • Then install the LTS version of node.js using nvm.
nvm install --lts
  • Then install the Netlify CLI again using the command
npm install netlify-cli -g

Let me know if the suggestions above works.
Hope this helps.
Thanks.

root@ca8e34ee5bd6:~/webapp# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15037  100 15037    0     0   863k      0 --:--:-- --:--:-- --:--:--  863k
=> nvm is already installed in /root/.nvm, trying to update using git
=> => Compressing and cleaning up git repository

=> nvm source string already in /root/.bashrc
=> bash_completion source string already in /root/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
root@ca8e34ee5bd6:~/webapp# nvm --help
-bash: nvm: command not found

So this is what i get after, it doesnt recognize nvm as a command

Kindly visit the nvm documentation at the link below on how to resolve the issue.

Once you successfully install nvm you can continue with the steps I initially suggested.
Thanks.

I have removed node & npm as you suggested.
Then nvm lts version installed.
Installing latest LTS version. as below.

Downloading and installing node v18.12.1...
Downloading https://nodejs.org/dist/v18.12.1/node-v18.12.1-darwin-arm64.tar.xz...
############################################################################################################################################################################# 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v18.12.1 (npm v8.19.2)
Creating default alias: default -> lts/* (-> v18.12.1)

But still not solved.

npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated statsd-client@0.4.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

Do you have other suggestions?

Hi @Jeremyjins, the quoted warning messages above indicates that you are using deprecated packages.
Kindly update the packages to see if it works.
Thanks.

@Jeremyjins,

I’m not seeing any problem in your code snippet. The warnings are expected and okay to be ignored. Please share full logs.

1 Like

I have consider these deprecated pkgs not serious affect on app except path issue occur and manually setup possible. Agree to ignore.

I updated pkgs and installed again but not really works. Mostly source-map-resolve has problem.
Some said micromatch install cannot solve problem but it didn’t work for me. Just ignore is ok for now.

1 Like