gpt4 book ai didi

node.js - 在 Ubuntu 16.04 和 Plesk Onyx 上安装 node.js npm

转载 作者:行者123 更新时间:2023-12-04 19:01:24 30 4
gpt4 key购买 nike

我关注 this guide安装 npm 而不用 sudo apt-get install npm 删除 Plesk(就像我已经做过的那样)大多数步骤似乎都已完成,但是当我运行 npm --version 时显示找不到命令 npm:

user@server:~$ npm --version
The program 'npm' is currently not installed. You can install it by typing:
sudo apt install npm
如果我这样做,我的 Plesk 将被卸载。
这是我运行时得到的 sudo apt-get -s install npm :

user@server:~$ sudo apt-get install -s npm

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

gyp libjs-inherits libjs-node-uuid libjs-underscore libuv1-dev node-abbrev node-ansi node-ansi-color-table node-archy node-async node-block-stream

node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent node-form-data node-fstream node-fstream-ignore node-github-url-from-git

node-glob node-graceful-fs node-gyp node-inherits node-ini node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp

node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once node-osenv node-qs node-read node-read-package-json

node-request node-retry node-rimraf node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent node-underscore node-which nodejs-dev

python-pkg-resources

Suggested packages:

javascript-common node-hawk node-aws-sign node-oauth-sign node-http-signature debhelper python-setuptools

Recommended packages:

javascript-common

The following NEW packages will be installed:

gyp libjs-inherits libjs-node-uuid libjs-underscore libuv1-dev node-abbrev node-ansi node-ansi-color-table node-archy node-async node-block-stream

node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent node-form-data node-fstream node-fstream-ignore node-github-url-from-git

node-glob node-graceful-fs node-gyp node-inherits node-ini node-json-stringify-safe node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp

node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once node-osenv node-qs node-read node-read-package-json

node-request node-retry node-rimraf node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent node-underscore node-which nodejs-dev npm

python-pkg-resources

0 upgraded, 54 newly installed, 0 to remove and 0 not upgraded.

Inst python-pkg-resources (20.7.0-1 Ubuntu:16.04/xenial [all])

Inst gyp (0.1+20150913git1f374df9-1ubuntu1 Ubuntu:16.04/xenial [all])

...

...

Inst node-sha (1.2.3-1 Ubuntu:16.04/xenial [all])

Inst node-slide (1.1.4-1 Ubuntu:16.04/xenial [all])

Inst npm (3.5.2-0ubuntu4 Ubuntu:16.04/xenial [all])

Conf python-pkg-resources (20.7.0-1 Ubuntu:16.04/xenial [all])

...

...

Conf node-retry (0.6.0-1 Ubuntu:16.04/xenial [all])

Conf node-sha (1.2.3-1 Ubuntu:16.04/xenial [all])

Conf node-slide (1.1.4-1 Ubuntu:16.04/xenial [all])

Conf npm (3.5.2-0ubuntu4 Ubuntu:16.04/xenial [all])

N: Ignoring file 'plesk.list.ai_back' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension


curl -L https://www.npmjs.com/install.sh | sudo sh 之后:

user@server:~$ curl -L https://www.npmjs.com/install.sh | sudo sh

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

100 6255 100 6255 0 0 12330 0 --:--:-- --:--:-- --:--:-- 12337

tar=/bin/tar

version:

tar (GNU tar) 1.28

Copyright (C) 2014 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

install npm@latest

fetching: https://registry.npmjs.org/npm/-/npm-5.3.0.tgz

added 1 package and removed 1 package in 1.433s

/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js

/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js

  • npm@5.3.0

updated 1 package in 2.473s

It worked


如果我运行 ls /usr/bin/npm我得到: /usr/bin/npm所以我可以使用 export PATH=$PATH:/usr/bin/npm 之类的东西或类似的东西?
提前致谢。

最佳答案

只需在 Plesk 安装程序中安装 native Node.js 支持,您将获得 npm

/opt/plesk/node/6/bin/npm



/opt/plesk/node/7/bin/npm

关于node.js - 在 Ubuntu 16.04 和 Plesk Onyx 上安装 node.js npm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45473659/

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