首页 文章

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

提问于
浏览
0

我按照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读取包列表...完成构建依赖关系树读取状态信息...完成将安装以下附加软件包: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建议的包: javascript-common node-hawk node-aws -sign node-oauth-sign node-http-signature debhelper python-setuptools推荐软件包:javascript-common将安装以下新软件包: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升级,54新安装,0删除0没升级 . 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节点 - 幻灯片(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节点重试(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 :忽略目录'/etc/apt/sources.list.d/'中的文件'plesk.list.ai_back',因为它的文件扩展名无效

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

user @ server:〜$ curl -L https://www.npmjs.com/install.sh | sudo sh%总收到百分比%Xferd平均速度时间时间时间当前Dload上传总剩余速度100 6255 100 6255 0 0 12330 0 - : - : - - : - : - - : - : - 12337 tar = / bin / tar版本:tar(GNU tar)1.28版权所有(C)2014 Free Software Foundation,Inc . 许可证GPLv3:GNU GPL版本3或更高版本http://gnu.org/licenses/gpl.html . 这是免费软件:您可以自由更改并重新分发它 . 在法律允许的范围内,不提供任何担保 . 由John Gilmore和Jay Fenlason撰写 . 安装npm @ latest fetching:https://registry.npmjs.org/npm/-/npm-5.3.0.tgz添加了1个软件包,并在1.433s / usr / bin / npm中删除了1个软件包 - > / 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更新了1包在2.473s中工作了

如果我运行 ls /usr/bin/npm 我得到: /usr/bin/npm 所以我可以使用像export _2751943这样的东西吗?

提前致谢 .

1 回答

  • 2

    只需在Plesk安装程序中安装本机Node.js支持即可获得npm as

    /选择的/ plesk /节点/ 6 /斌/ NPM

    /选择的/ plesk /节点/ 7 /斌/ NPM

相关问题