簡體   English   中英

我該如何修復Windows 10中的npm build錯誤?

[英]How do i fix npm build error in windows 10?

我嘗試了所有操作,但什至無法安裝單個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:\\ Users \\ 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

您上述錯誤的原因有很多。 像您的系統一樣,沒有獲得正確的buildsystem路徑。

項目的名稱也很重要。

您的CMD權利也很重要,例如[ Run as an Administrator ]。

您是否已使用npm init初始化了您的項目? 還寫了找不到package.json 您正在Windows根用戶目錄(此處為Dell )上安裝npm庫。 不要那樣做

創建一個單獨的目錄,並使用Administrator通過CMD cd dir 使用npm init初始化目錄。 然后嘗試使用(即npm i bootstrap )安裝各自的庫。

這可能對您有幫助。 如果沒有,這是最佳做法。 在使用Node時,應遵循。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM