Установка NPM локальная проблема

Я прочитал документацию, как установить npm. Tryed:

~ curl -sL https://deb.nodesource.com/setup | sudo -E bash -
~ sudo apt-get install -y nodejs
~ nodejs -v
>> v0.10.48
~ node -v
>> v7.4.0
~ npm -v
>> bash: / usr / local / bin / npm: No such file or directory

попытайтесь установить npm непосредственно:

~ sudo apt-get install npm
npm: Depends: nodejs but it will not be installed
       Depends: node-abbrev (> = 1.0.4) but it is not installed
       Depends: node-ansi but it will not be installed
       Depends: node-archy but it will not be installed
       Depends: node-block-stream but it will not be installed
       Depends: node-fstream (> = 0.1.22) but it is not installed
       Depends: node-fstream-ignore but it is not installed
       Depends: node-github-url-from-git but he will not be installed
       Depends: node-glob (> = 3.1.21) but it is not installed
       Depends: node-graceful-fs (> = 2.0.0) but it is not installed
       Depends: node-inherits but it will not be installed
       Depends: node-ini (> = 1.1.0) but it is not installed
       Depends: node-lockfile but it will not be installed
       Depends: node-lru-cache (> = 2.3.0) but it is not installed
       Depends: node-minimatch (> = 0.2.11) but it is not installed
       Depends: node-mkdirp (> = 0.3.3) but it is not installed
       Depends: node-gyp (> = 0.10.9) but it will not be installed
       Depends: node-nopt (> = 2.1.1) but it is not installed
       Depends: node-npmlog but it will not be installed
       Depends: node-once but it will not be installed
       Depends: node-osenv but it will not be installed
       Depends: node-read but it is not installed
       Depends: node-read-package-json (> = 1.1.0) but it is not installed
       Depends: node-request (> = 2.25.0) but it will not be installed
       Depends: node-retry but it will not be installed
       Depends: node-rimraf (> = 2.2.2) but it is not installed
       Depends: node-semver (> = 2.1.0) but it is not installed
       Depends: node-sha but it will not be installed
       Depends: node-slide but it will not be installed
       Depends: node-tar (> = 0.1.18) but it is not installed
       Depends: node-which but it will not be installed
E: Unable to correct problems, you have delayed (held) broken packages.

Позволяет посмотрите сохраненный

~ dpkg --get-selections | grep hold
>> [no results]

Какие-либо идеи состоят в том, чтобы попробовать?


Больше деталей после попытки сделать что-то:

sudo update-alternatives --install / usr / bin / node nodejs / usr / bin / nodejs 100
update-alternatives: error: alternative link / usr / bin / node already controlled node

Я попробовал, продолжают следующую инструкцию, не решая предыдущую ошибку (я не знаю, как решить ее).

~ sudo curl https://www.npmjs.com/install.sh | sh
/ Usr / local / bin / npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/ Usr / local / lib
└── (empty)

npm ERR! Linux 3.13.0-37-generic
npm ERR! argv "/ usr / local / bin / node" "/tmp/npm.26355/package/cli.js" "install" "-gf"
npm ERR! node v7.4.0
npm ERR! npm v4.1.1
npm ERR! path ../../../../../tmp/npm.26355/package/man/man1/npm-access.1
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink

npm ERR! Error: EACCES: permission denied, symlink '../../../../../tmp/npm.26355/package/man/man1/npm-access.1' -> '/ usr / local / share / man / man1 / npm-access.1 '
npm ERR! {Error: EACCES: permission denied, symlink '../../../../../tmp/npm.26355/package/man/man1/npm-access.1' -> '/ usr / local /share/man/man1/npm-access.1 '
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../../../../../tmp/npm.26355/package/man/man1/npm-access.1',
npm ERR! dest: '/usr/local/share/man/man1/npm-access.1'}
npm ERR!
npm ERR! Please try running this command again as root / Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /tmp/npm.26355/package/npm-debug.log
It failed
0
задан 19 January 2017 в 06:15

1 ответ

Хорошо, удалите npm (Вы уже знаете, как), удалите nodejs, сделайте apt-get autoremove.Далее:

sudo apt-get install nodejs
sudo update-alternatives --install /usr/bin/node nodejs /usr/bin/nodejs 100
sudo curl https://www.npmjs.com/install.sh | sudo sh

, Который должен быть этим.

0
ответ дан 7 November 2019 в 03:35

Другие вопросы по тегам:

Похожие вопросы: