npm install jspdf@1.5.3失败

时间:2019-03-27 14:41:20

标签: node.js npm jspdf

当我尝试使用npm更新jspdf时,出现此错误:

C:\Users\lm\Documents\git\mbgest2\bin>npm install jspdf@^1.5.3
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
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\lm\AppData\Roaming\npm-cache\_logs\2019-03-27T14_28_31_623Z-debug.log

幸运的是,我能够重新安装旧版本1.3.5。我不确定我的安装是否有问题,或者最新jspdf(1.5.3)的npm配置是否包含错误。我删除了npm缓存,但没有帮助(C:\Users\lm\AppData\Roaming\npm-cache)。

如何将jspdf更新到最新版本?

这里是生成的错误日志文件的摘录。

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\lm\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'jspdf@1.5.3' ]
2 info using npm@6.9.0
3 info using node@v8.9.4
4 verbose npm-session 9894d1fdba8a645b
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/jspdf 177ms (from cache)
8 silly pacote version manifest for jspdf@1.5.3 fetched in 192ms
9 timing stage:loadCurrentTree Completed in 2314ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 16ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 655ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule jspdf@1.5.3 checking installable status
17 silly removeObsoleteDep removing jspdf@1.3.5 from the tree as its been replaced by a newer version or is no longer required
18 silly removeObsoleteDep removing adler32cs@0.0.1 from the tree as its been replaced by a newer version or is no longer required
19 silly removeObsoleteDep removing cf-blob.js@0.0.1 from the tree as its been replaced by a newer version or is no longer required
20 silly removeObsoleteDep removing file-saver@1.3.3 from the tree as its been replaced by a newer version or is no longer required
21 silly fetchPackageMetaData error for file-saver@github:eligrey/FileSaver.js#1.3.8 Error while executing:
21 silly fetchPackageMetaData undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
...
40 verbose stack Error: spawn git ENOENT
40 verbose stack     at _errnoException (util.js:1022:11)
40 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
40 verbose stack     at onErrorNT (internal/child_process.js:372:16)
40 verbose stack     at _combinedTickCallback (internal/process/next_tick.js:138:11)
40 verbose stack     at process._tickCallback (internal/process/next_tick.js:180:9)
41 verbose cwd C:\Users\lm\Documents\git\mbgest2\bin
42 verbose Windows_NT 10.0.17763
43 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\lm\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "jspdf@1.5.3"
44 verbose node v8.9.4
45 verbose npm  v6.9.0
46 error path git
47 error code ENOENT
48 error errno ENOENT
49 error syscall spawn git
50 error enoent Error while executing:
50 error enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
50 error enoent
50 error enoent
50 error enoent spawn git ENOENT
51 error enoent This is related to npm not being able to find a file.
52 verbose exit [ 1, true ]

1 个答案:

答案 0 :(得分:0)

您使用nodejs npm。 您需要一个包含package.json的路径,而不直接更新组件。 我想。

  

C:\ Users \ lm \ Documents \ git \ mbgest2 \

包含项目的路径。