Как исправить ошибку сборки npm в Windows 10? - PullRequest
0 голосов
/ 27 февраля 2019

Я перепробовал все, но не смог установить даже один модуль npm.

Как это исправить?

Microsoft Windows [Version 10.0.17134.590]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Users\Dell\Desktop\npmtestfolder>npm install bootstrap

ed25519@0.0.4 установить C: \Пользователи \ Dell \ node_modules \ ed25519 Перестройка node-gyp

C:\Users\Dell\node_modules\ed25519>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Users\Dell\node_modules\ed25519\build\ed25519.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.D
efault.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on
disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Dell\node_modules\ed25519
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\Dell\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Dell\package.json'
npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN Dell No description
npm WARN Dell No repository field.
npm WARN Dell No README data
npm WARN Dell No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ed25519@0.0.4 (node_modules\ed25519):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ed25519@0.0.4 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ bootstrap@4.3.1
updated 1 package and audited 5449 packages in 13.153s
found 0 vulnerabilities

1 Ответ

0 голосов
/ 27 февраля 2019

Есть много причин для вашей вышеупомянутой ошибки.Как будто ваша система не получает правильный путь к buildsystem.

Название вашего проекта также имеет значение.

Права вашего CMD тоже важны, как [Run as an Administrator].

Вы инициализировали свой проект с npm init?Там же написано, что package.json не найдено.Вы устанавливаете библиотеку npm в корневой директории пользователя Windows (здесь Dell ваша).Не делай этого.

Создайте отдельный каталог и cd ваш dir с помощью CMD с Administrator.Инициализируйте ваш каталог с npm init.Затем попробуйте установить соответствующие библиотеки с (например, npm i bootstrap).

Это может вам помочь.А если нет, то это лучшие практики.Вы должны следовать, когда вы работаете над узлом.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...