npm WARN tar ENOENT нет такого файла или директории - PullRequest
1 голос
/ 16 мая 2019

я запускаю npm install У меня есть машинный пакет package.json и package-lock.json, поэтому я не могу его изменить. Я на линуксе У меня нет доступа к sudo ошибки

npm WARN notice [SECURITY] static-eval has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=static-eval&version=2.0.2 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] timespan has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=timespan&version=2.3.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] open has the following vulnerability: 1 critical. Go here for more details: https://nodesecurity.io/advisories?search=open&version=6.0.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] tunnel-agent has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=tunnel-agent&version=0.4.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN notice [SECURITY] hoek has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN tar ENOENT: no such file or directory, open '/.../node_modules/.staging/typescript-8be04997/lib/zh-CN/diagnosticMessages.generated.json'
npm ERR! code EINTEGRITY
npm ERR! sha512-A4E89MA+kto8giic7zyLU6ZxfXnVeCUlKOyzFsah3+n4BROx4bgonl92KIBtwLud/mIWir8ahqhuhe2by9LakQ== integrity checksum failed when using sha512: wanted sha512-A4E89MA+kto8giic7zyLU6ZxfXnVeCUlKOyzFsah3+n4BROx4bgonl92KIBtwLud/mIWir8ahqhuhe2by9LakQ== but got sha512-x1FIOIOdtF5FC5f7q1galS64Nd4mtcgjdIPX7tV7NkNPotDdmov1DjLrAuGTEFme+0R8N2plqO29pp9IEUXb5Q==. (7879388 bytes)

npm ERR! A complete log of this run can be found in:

журнал введите код здесь

30346 verbose stack Error: sha512-A4E89MA+kto8giic7zyLU6ZxfXnVeCUlKOyzFsah3+n4BROx4bgonl92KIBtwLud/mIWir8ahqhuhe2by9LakQ== integrity checksum failed when using sha512: wanted sha512-A4E89MA+kto8giic7zyLU6ZxfXnVeCUlKOyzFsah3+n4BROx4bgonl92KIBtwLud/mIWir8ahqhuhe2by9LakQ== but got sha512-x1FIOIOdtF5FC5f7q1galS64Nd4mtcgjdIPX7tV7NkNPotDdmov1DjLrAuGTEFme+0R8N2plqO29pp9IEUXb5Q==. (7879388 bytes)
30346 verbose stack     at Transform.on (/home/x86_64-unknown-linux_ol7-gnu/node-v8.11.1/lib/node_modules/npm/node_modules/ssri/index.js:275:19)
30346 verbose stack     at emitNone (events.js:111:20)
30346 verbose stack     at Transform.emit (events.js:208:7)
30346 verbose stack     at endReadableNT (_stream_readable.js:1064:12)
30346 verbose stack     at _combinedTickCallback (internal/process/next_tick.js:138:11)
30346 verbose stack     at process._tickCallback (internal/process/next_tick.js:180:9)
30347 verbose [folder where I run npm install]
30348 verbose Linux 3.10.0-957.12.1.el7.x86_64
30349 verbose argv "/home/x86_64-unknown-linux_ol7-gnu/node-v8.11.1/bin/node" "/home/x86_64-unknown-linux_ol7-gnu/node-v8.11.1/bin/npm" "install"
30350 verbose node v8.11.1
30351 verbose npm  v5.6.0
30352 error code EINTEGRITY
30353 error sha512-A4E89MA+kto8giic7zyLU6ZxfXnVeCUlKOyzFsah3+n4BROx4bgonl92KIBtwLud/mIWir8ahqhuhe2by9LakQ== integrity checksum failed when using sha512: wanted sha512-A4E89MA+kto8giic7zyLU6ZxfXnVeCUlKOyzFsah3+n4BROx4bgonl92KIBtwLud/mIWir8ahqhuhe2by9LakQ== but got sha512-x1FIOIOdtF5FC5f7q1galS64Nd4mtcgjdIPX7tV7NkNPotDdmov1DjLrAuGTEFme+0R8N2plqO29pp9IEUXb5Q==. (7879388 bytes)
30354 verbose exit [ 1, true ]

Я ожидаю, что установка npm действительно будет работать

Ответы [ 2 ]

2 голосов
/ 16 мая 2019

Эту проблему можно решить следующими способами:

1. Убедитесь, что зависимости правильно описаны в файле package.json

2. Просто введите npm install и нажмите Enter.

3. Проверьте, проблема по-прежнему существует.и Если проблема не решена, продолжайте эти методы.

4. type npm cache очистите и нажмите Enter

5.type sudo npm install -g npm и нажмите Enter.

6. Повторите установку npm и нажмите Enter.

0 голосов
/ 19 июля 2019

после множества попыток, включая npm обновление, что помогло в моем случае:

  • rm -rf node_modues package-lock.json
  • npm i

ключ, я полагаю, удаляет package-lock.json вместе с npm_modules.

это, скорее всего, было связано с переключением между ветвями с уже установленными модулями.

...