Многократные ошибки установки NPM - PullRequest
0 голосов
/ 03 ноября 2018

Когда я пытаюсь установить npm, консоль выдает следующие ошибки и предупреждения:

npm WARN checkPermissions Missing write access to C:\Users\Aristophanes\node_modules\web3
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@2.1.0 requires a peer of babel-eslint@^7.2.3 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@2.1.0 requires a peer of eslint@^4.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-loader@1.9.0 requires a peer of eslint@>=1.6.0 <5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-jsx-a11y@5.1.1 requires a peer of eslint@^2.10.2 || ^3 || ^4 but none is installed. You must install peer dependencies yourself.
npm WARN firebase-functions@2.1.0 requires a peer of firebase-admin@~6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path C:\Users\Aristophanes\node_modules\web3
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:\Users\Aristophanes\node_modules\web3'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Aristophanes\AppData\Roaming\npm-cache\_logs\2018-11-02T23_13_12_948Z-debug.log

Кто-нибудь знает, как я могу это исправить? Спасибо.

Ответы [ 2 ]

0 голосов
/ 04 ноября 2018

Для этого есть 2 решения.

**1. Reinstall npm with a Node version manager (recommended).**

Это лучший способ избежать проблем с разрешениями. Для получения дополнительной информации перейдите по этой ссылке (https://docs.npmjs.com/getting-started/installing-node#using-a-version-manager-to-install-nodejs-and-npm) Вам не нужно удалять текущую версию npm или Node.js перед установкой менеджера версий Node.

**2. Change npm's default directory manually.**

Если вы не используете Windows, вы можете использовать следующие шаги.

To minimize the chance of permissions errors, you can configure npm to use a different directory. In this example, it will be a hidden directory on your home folder.

Back-up your computer before you start.

Make a directory for global installations:

mkdir ~ / .npm-global

Configure npm to use the new directory path:

npm config prefix '~ / .npm-global'

Open or create a ~/.profile file and add this line:

export PATH = ~ / .npm-global / bin: $ PATH

Back on the command line, update your system variables:

source ~ / .profile

Тест: загрузка пакета по всему миру без использования sudo.

npm install -g jshint

Вместо шагов 2-4 вы можете использовать соответствующую переменную ENV (например, если вы не хотите изменять ~ / .profile):

 NPM_CONFIG_PREFIX=~/.npm-global
0 голосов
/ 04 ноября 2018

Попробуйте удалить папку web3 в C:\Users\Aristophanes\node_modules\web3, а также папку node_modules в каталоге проекта (если существует). Надеюсь, это поможет вам:)

...