gpt4 book ai didi

javascript - curl获取的文件如何清除

转载 作者:搜寻专家 更新时间:2023-10-31 23:58:24 25 4
gpt4 key购买 nike

我正在开发 Debian Stable Linux(定期更新)。我从存储库安装了 nodejs,但没有获得 nodenpm 命令。因此,我尝试使用此页面中的说明:https://www.npmjs.com/package/node-compile/tutorial :

我运行了这个命令:

$ curl -sL https://deb.nodesource.com/setup | sudo -E bash -

虽然我收到了一条“已弃用”的消息,但我还是允许它运行。然后我跑了:

$ sudo apt-get install -y nodejs

但是,nodejs 命令仍然不可用。然后我安装了 nodejs-dev 但仍然没有成功。如上链接所示,node -vnpm -v 仍然不起作用。

因此,我删除(清除)了 nodejs 和 nodejs-dev 包。我有两个问题:

  1. 上面的 curl 命令是否有任何我需要撤销的更改?

  2. 如何获取nodenpm命令?

感谢您的帮助。

编辑:

以下是用于安装的命令的输出:

$ curl -sL https://deb.nodesource.com/setup | sudo -E bash -

================================================================================
================================================================================

SCRIPT DEPRECATION WARNING

This script, located at https://deb.nodesource.com/setup, used to
install Node.js v0.10, is being deprecated and will eventually be made
inactive.

You should use the script that corresponds to the version of Node.js you
wish to install. e.g.

* https://deb.nodesource.com/setup_4.x — Node.js v4 LTS "Argon" (recommended)
* https://deb.nodesource.com/setup_6.x — Node.js v6 Current

Please see https://github.com/nodejs/LTS/ for details about which version
may be appropriate for you.

The NodeSource Node.js Linux distributions GitHub repository contains
information about which versions of Node.js and which Linux distributions
are supported and how to use the install scripts.
https://github.com/nodesource/distributions

================================================================================
================================================================================

Continuing in 10 seconds (press Ctrl-C to abort) ...


## Installing the NodeSource Node.js v0.10 repo...


## Populating apt-get cache...

+ apt-get update
Ign:1 http://debianmirror.nkn.in/debian stretch InRelease
Get:2 http://debianmirror.nkn.in/debian stretch-updates InRelease [91.0 kB]
Hit:3 http://download.virtualbox.org/virtualbox/debian stretch InRelease
Hit:4 http://debianmirror.nkn.in/debian stretch Release
Get:5 http://security.debian.org/debian-security stretch/updates InRelease [62.9 kB]
Get:6 http://debianmirror.nkn.in/debian stretch-updates/main i386 Packages.diff/Index [1,720 B]
Hit:7 http://master.dl.sourceforge.net/project/d-apt d-apt InRelease
Get:8 http://debianmirror.nkn.in/debian stretch-updates/main Translation-en.diff/Index [1,720 B]
Get:9 http://debianmirror.nkn.in/debian stretch-updates/main i386 Contents (deb).diff/Index [2,212 B]
Get:11 http://debianmirror.nkn.in/debian stretch-updates/main i386 Packages 2017-10-26-2029.42.pdiff [871 B]
Get:12 http://debianmirror.nkn.in/debian stretch-updates/main Translation-en 2017-10-26-2029.42.pdiff [544 B]
Get:11 http://debianmirror.nkn.in/debian stretch-updates/main i386 Packages 2017-10-26-2029.42.pdiff [871 B]
Get:12 http://debianmirror.nkn.in/debian stretch-updates/main Translation-en 2017-10-26-2029.42.pdiff [544 B]
Get:13 http://debianmirror.nkn.in/debian stretch-updates/main i386 Contents (deb) 2017-10-26-2029.42.pdiff [15.9 kB]
Get:13 http://debianmirror.nkn.in/debian stretch-updates/main i386 Contents (deb) 2017-10-26-2029.42.pdiff [15.9 kB]
Get:14 http://security.debian.org/debian-security stretch/updates/main i386 Packages [186 kB]
Get:15 http://security.debian.org/debian-security stretch/updates/main Translation-en [86.2 kB]
Fetched 449 kB in 3s (144 kB/s)
Reading package lists... Done

## Installing packages required for setup: apt-transport-https...

+ apt-get install -y apt-transport-https > /dev/null 2>&1

## You seem to be using Debian version stretch.
## This maps to Debian "jessie"... Adjusting for you...

## Confirming "jessie" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_0.10/dists/jessie/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
OK

## Creating apt sources list file for the NodeSource Node.js v0.10 repo...

+ echo 'deb https://deb.nodesource.com/node_0.10 jessie main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_0.10 jessie main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Ign:1 http://debianmirror.nkn.in/debian stretch InRelease
Hit:2 http://download.virtualbox.org/virtualbox/debian stretch InRelease
Hit:3 http://security.debian.org/debian-security stretch/updates InRelease
Hit:4 http://master.dl.sourceforge.net/project/d-apt d-apt InRelease
Get:5 https://deb.nodesource.com/node_0.10 jessie InRelease [3,899 B]
Hit:6 http://debianmirror.nkn.in/debian stretch-updates InRelease
Hit:7 http://debianmirror.nkn.in/debian stretch Release
Get:9 https://deb.nodesource.com/node_0.10 jessie/main Sources [687 B]
Get:10 https://deb.nodesource.com/node_0.10 jessie/main i386 Packages [928 B]
Fetched 5,514 B in 2s (2,686 B/s)
Reading package lists... Done

================================================================================
================================================================================

NODE.JS v0.10 DEPRECATION WARNING

Node.js v0.10 will cease to be actively supported in October 2016.

This means you will not continue to receive security or critical stability
updates for this version of Node.js beyond that time.

You should begin migration to a newer version of Node.js as soon as
possible. Use the installation script that corresponds to the version of
Node.js you wish to install. e.g.

* https://deb.nodesource.com/setup_4.x — Node.js v4 LTS "Argon" (recommended)
* https://deb.nodesource.com/setup_6.x — Node.js v6 Current

Please see https://github.com/nodejs/LTS/ for details about which version
may be appropriate for you.

The NodeSource Node.js Linux distributions GitHub repository contains
information about which versions of Node.js and which Linux distributions
are supported and how to use the install scripts.
https://github.com/nodesource/distributions

================================================================================
================================================================================

Continuing in 5 seconds ...


## Run `apt-get install nodejs` (as root) to install Node.js v0.10 and npm

$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libuv1
The following NEW packages will be installed:
libuv1 nodejs
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/3,512 kB of archives.
After this operation, 13.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Selecting previously unselected package libuv1:i386.
(Reading database ... 255826 files and directories currently installed.)
Preparing to unpack .../libuv1_1.9.1-3_i386.deb ...
Unpacking libuv1:i386 (1.9.1-3) ...
Selecting previously unselected package nodejs.
Preparing to unpack .../nodejs_4.8.2~dfsg-1_i386.deb ...
Unpacking nodejs (4.8.2~dfsg-1) ...
Setting up libuv1:i386 (1.9.1-3) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up nodejs (4.8.2~dfsg-1) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode

$

最佳答案

curl -sL https://deb.nodesource.com/setup | sudo -E bash -

它下载一个 bash 脚本并直接以 sudo 权限执行。这可能非常危险。不要这样做。

取而代之的是 curl -O https://deb.nodesource.com/setup只需通过 less setup 检查脚本。如果没问题,执行 sudo setup

回答您的第一个问题。

setup 是一个包安装脚本。它将一些包添加到 sources.list 并安装一些 gpg key 。没有必要撤销它所做的更改。

关于javascript - curl获取的文件如何清除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46970248/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com