npm 当运行“巴别双截棍--out-dir”时,消息“双截棍不存在”(代码2)

rn0zuynd  于 2023-01-05  发布在  其他
关注(0)|答案(1)|浏览(3102)

我已在PC中安装了Windows 10节点16.13.2和NPM版本9.1.2。我已全局安装了npm包

  • Babel-客户界面6.26.0
  • 双截棍3.2.3
  • 国际双截棍1.0.3
  • 前页4.0.2
  • 文件系统-附加10.1.0
  • 滴8.0.3

我运行命令npm link nunjucks
答复如下:

npm ERR! code 2
npm ERR! path C:\\Users\\sw42\\AppData\\Roaming\\npm\\node_modules\\nunjucks
npm ERR! command failed
npm ERR! command C:\\Windows\\system32\\cmd.exe /d /s /c npm run build
npm ERR! \> nunjucks@3.2.3 build
npm ERR! \> npm run build:transpile && npm run build:bundle
npm ERR!
npm ERR!
npm ERR! \> nunjucks@3.2.3 build:transpile
npm ERR! \> babel nunjucks --out-dir .
npm ERR! nunjucks doesn't exist

以下是完整的日志

0 verbose cli C:\Program Files\nodejs\node.exe C:\Users\sw42\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
1 info using npm@9.1.2
2 info using node@v16.13.2
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Users\sw42\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 6ms
6 timing config:load:builtin Completed in 6ms
7 timing config:load:cli Completed in 7ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\sw42\workspace\site-web\siteinnes2019\.npmrc Completed in 0ms
10 timing config:load:project Completed in 4ms
11 timing config:load:file:C:\Users\sw42\.npmrc Completed in 4ms
12 timing config:load:user Completed in 5ms
13 timing config:load:file:C:\Users\sw42\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 2ms
16 timing config:load Completed in 28ms
17 timing npm:load:configload Completed in 29ms
18 timing npm:load:mkdirpcache Completed in 1ms
19 timing npm:load:mkdirplogs Completed in 1ms
20 verbose title npm link nunjucks
21 verbose argv "link" "nunjucks"
22 timing npm:load:setTitle Completed in 2ms
23 timing config:load:flatten Completed in 4ms
24 timing npm:load:display Completed in 5ms
25 verbose logfile logs-max:10 dir:C:\Users\sw42\AppData\Local\npm-cache\_logs\2022-11-23T10_18_24_895Z-
26 verbose logfile C:\Users\sw42\AppData\Local\npm-cache\_logs\2022-11-23T10_18_24_895Z-debug-0.log
27 timing npm:load:logFile Completed in 27ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 67ms
31 silly logfile start cleaning logs, removing 1 files
32 timing config:load:flatten Completed in 1ms
33 timing config:load:flatten Completed in 1ms
34 timing arborist:ctor Completed in 1ms
35 silly logfile done cleaning log files
36 timing arborist:ctor Completed in 0ms
37 timing idealTree:init Completed in 101ms
38 timing arborist:ctor Completed in 0ms
39 timing idealTree:userRequests Completed in 144ms
40 silly idealTree buildDeps
41 silly placeDep ROOT nunjucks@3.2.3 OK for: website@1.10.10 want: file:../../../AppData/Roaming/npm/node_modules/nunjucks
42 timing idealTree:#root Completed in 13ms
43 timing idealTree:node_modules/nunjucks Completed in 0ms
44 timing idealTree:buildDeps Completed in 19ms
45 timing idealTree:fixDepFlags Completed in 8ms
46 timing idealTree Completed in 276ms
47 timing reify:loadTrees Completed in 278ms
48 timing reify:diffTrees Completed in 11ms
49 silly reify moves {}
50 timing reify:retireShallow Completed in 2ms
51 timing reify:createSparse Completed in 3ms
52 timing reify:loadBundles Completed in 0ms
53 silly audit bulk request {
53 silly audit   ajv: [ '6.12.6' ],
53 silly audit   anymatch: [ '3.1.3' ],
53 silly audit   asn1: [ '0.2.6' ],
53 silly audit   'assert-plus': [ '1.0.0' ],
53 silly audit   async: [ '3.2.4' ],
53 silly audit   asynckit: [ '0.4.0' ],
53 silly audit   'aws-sign2': [ '0.7.0' ],
53 silly audit   aws4: [ '1.11.0' ],
53 silly audit   'balanced-match': [ '1.0.2' ],
53 silly audit   'bcrypt-pbkdf': [ '1.0.2' ],
53 silly audit   'binary-extensions': [ '2.2.0' ],
53 silly audit   'brace-expansion': [ '2.0.1' ],
53 silly audit   braces: [ '3.0.2' ],
53 silly audit   caseless: [ '0.12.0' ],
53 silly audit   chokidar: [ '3.5.3' ],
53 silly audit   'combined-stream': [ '1.0.8' ],
53 silly audit   'core-util-is': [ '1.0.2' ],
53 silly audit   dashdash: [ '1.14.1' ],
53 silly audit   'delayed-stream': [ '1.0.0' ],
53 silly audit   dependencies: [ '0.0.1' ],
53 silly audit   'ecc-jsbn': [ '0.1.2' ],
53 silly audit   elementtree: [ '0.1.7' ],
53 silly audit   extend: [ '3.0.2' ],
53 silly audit   extsprintf: [ '1.3.0' ],
53 silly audit   'fast-deep-equal': [ '3.1.3' ],
53 silly audit   'fast-json-stable-stringify': [ '2.1.0' ],
53 silly audit   'fill-range': [ '7.0.1' ],
53 silly audit   fluent: [ '0.11.0' ],
53 silly audit   fontoxpath: [ '3.28.2' ],
53 silly audit   'forever-agent': [ '0.6.1' ],
53 silly audit   'form-data': [ '2.3.3' ],
53 silly audit   'fs.realpath': [ '1.0.0' ],
53 silly audit   fsevents: [ '2.3.2' ],
53 silly audit   getpass: [ '0.1.7' ],
53 silly audit   glob: [ '8.0.3' ],
53 silly audit   'glob-parent': [ '5.1.2' ],
53 silly audit   'har-schema': [ '2.0.0' ],
53 silly audit   'har-validator': [ '5.1.5' ],
53 silly audit   'http-signature': [ '1.2.0' ],
53 silly audit   inflight: [ '1.0.6' ],
53 silly audit   inherits: [ '2.0.4' ],
53 silly audit   'is-binary-path': [ '2.1.0' ],
53 silly audit   'is-extglob': [ '2.1.1' ],
53 silly audit   'is-glob': [ '4.0.3' ],
53 silly audit   'is-number': [ '7.0.0' ],
53 silly audit   'is-typedarray': [ '1.0.0' ],
53 silly audit   isstream: [ '0.1.2' ],
53 silly audit   jsbn: [ '0.1.1' ],
53 silly audit   'json-schema': [ '0.4.0' ],
53 silly audit   'json-schema-traverse': [ '0.4.1' ],
53 silly audit   'json-stringify-safe': [ '5.0.1' ],
53 silly audit   jsprim: [ '1.4.2' ],
53 silly audit   link: [ '1.5.1' ],
53 silly audit   'mime-db': [ '1.52.0' ],
53 silly audit   'mime-types': [ '2.1.35' ],
53 silly audit   minimatch: [ '5.1.0' ],
53 silly audit   'node-walker': [ '0.1.0' ],
53 silly audit   'normalize-path': [ '3.0.0' ],
53 silly audit   'oauth-sign': [ '0.9.0' ],
53 silly audit   once: [ '1.4.0' ],
53 silly audit   'performance-now': [ '2.1.0' ],
53 silly audit   picomatch: [ '2.3.1' ],
53 silly audit   prsc: [ '4.0.0' ],
53 silly audit   psl: [ '1.9.0' ],
53 silly audit   punycode: [ '2.1.1' ],
53 silly audit   qs: [ '6.5.3' ],
53 silly audit   readdirp: [ '3.6.0' ],
53 silly audit   request: [ '2.88.2' ],
53 silly audit   'safe-buffer': [ '5.2.1' ],
53 silly audit   'safer-buffer': [ '2.1.2' ],
53 silly audit   sax: [ '1.1.4' ],
53 silly audit   sshpk: [ '1.17.0' ],
53 silly audit   'to-regex-range': [ '5.0.1' ],
53 silly audit   'tough-cookie': [ '2.5.0' ],
53 silly audit   'tunnel-agent': [ '0.6.0' ],
53 silly audit   tweetnacl: [ '0.14.5' ],
53 silly audit   underscore: [ '1.13.6' ],
53 silly audit   'uri-js': [ '4.4.1' ],
53 silly audit   uuid: [ '3.4.0' ],
53 silly audit   verror: [ '1.10.0' ],
53 silly audit   whynot: [ '5.0.0' ],
53 silly audit   wrappy: [ '1.0.2' ],
53 silly audit   xmldom: [ '0.1.31' ],
53 silly audit   xpath: [ '0.0.27' ],
53 silly audit   xspattern: [ '3.0.0' ],
53 silly audit   nunjucks: [ '3.2.3' ]
53 silly audit }
54 verbose reify failed optional dependency C:\Users\sw42\workspace\site-web\siteinnes2019\node_modules\fsevents
55 silly reify mark deleted [
55 silly reify   'C:\\Users\\sw42\\workspace\\site-web\\siteinnes2019\\node_modules\\fsevents'
55 silly reify ]
56 timing reifyNode:node_modules/fsevents Completed in 31ms
57 timing reifyNode:node_modules/nunjucks Completed in 38ms
58 timing reify:unpack Completed in 38ms
59 timing reify:unretire Completed in 0ms
60 timing build:queue Completed in 2ms
61 timing build:deps Completed in 2ms
62 timing build:queue Completed in 1ms
63 info run nunjucks@3.2.3 prepare ../../../AppData/Roaming/npm/node_modules/nunjucks npm run build
64 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 530ms
65 timing auditReport:getReport Completed in 551ms
66 silly audit report {
66 silly audit report   xmldom: [
66 silly audit report     {
66 silly audit report       id: 1082377,
66 silly audit report       url: 'https://github.com/advisories/GHSA-h6q6-9hqw-rwfv',
66 silly audit report       title: 'Misinterpretation of malicious XML input',
66 silly audit report       severity: 'low',
66 silly audit report       vulnerable_versions: '<0.5.0',
66 silly audit report       cwe: [Array],
66 silly audit report       cvss: [Object]
66 silly audit report     },
66 silly audit report     {
66 silly audit report       id: 1067480,
66 silly audit report       url: 'https://github.com/advisories/GHSA-5fg8-2547-mr8q',
66 silly audit report       title: 'Misinterpretation of malicious XML input',
66 silly audit report       severity: 'moderate',
66 silly audit report       vulnerable_versions: '<0.7.0',
66 silly audit report       cwe: [Array],
66 silly audit report       cvss: [Object]
66 silly audit report     },
66 silly audit report     {
66 silly audit report       id: 1084901,
66 silly audit report       url: 'https://github.com/advisories/GHSA-crh6-fp67-6883',
66 silly audit report       title: 'xmldom allows multiple root nodes in a DOM',
66 silly audit report       severity: 'critical',
66 silly audit report       vulnerable_versions: '<=0.6.0',
66 silly audit report       cwe: [Array],
66 silly audit report       cvss: [Object]
66 silly audit report     }
66 silly audit report   ]
66 silly audit report }
67 timing metavuln:cache:get:security-advisory:xmldom:/MQv5neyFkpqCwEgiWI7HukCHE6jept1Ax0cof+0WPKRxMwNUnIFMmJn7uG47uAqtXEawZZo8/XeyU9ZU9mBRg== Completed in 11ms
68 timing metavuln:cache:get:security-advisory:xmldom:RcByQplMDvoVV0qNhgWHzd/g+vdOJRoIiT3JCqCzfDdY0tPEaebbRW+gKiBewTE8TSkjFHoqmUp6YHlX6l08jA== Completed in 14ms
69 timing metavuln:cache:get:security-advisory:xmldom:ujUrXa1B0oSIkeBAqBIIxletsXHqAWswoc/e+flOOPqm/KAnxBbYNhvVC4j1m+qOd9sahOsks6N03rEUdRqBeg== Completed in 13ms
70 http fetch GET 200 https://registry.npmjs.org/xmldom 72ms (cache revalidated)
71 timing metavuln:packument:xmldom Completed in 73ms
72 timing metavuln:load:security-advisory:xmldom:1082377 Completed in 1ms
73 timing metavuln:calculate:security-advisory:xmldom:1082377 Completed in 75ms
74 timing metavuln:load:security-advisory:xmldom:1067480 Completed in 0ms
75 timing metavuln:calculate:security-advisory:xmldom:1067480 Completed in 74ms
76 timing metavuln:load:security-advisory:xmldom:1084901 Completed in 1ms
77 timing metavuln:calculate:security-advisory:xmldom:1084901 Completed in 74ms
78 timing auditReport:init Completed in 83ms
79 timing reify:audit Completed in 635ms
80 info run nunjucks@3.2.3 prepare { code: 2, signal: null }
81 timing reify:rollback:createSparse Completed in 1ms
82 timing reify:rollback:retireShallow Completed in 0ms
83 timing command:link Completed in 6422ms
84 verbose stack Error: command failed
84 verbose stack     at ChildProcess.<anonymous> (C:\Users\sw42\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:53:27)
84 verbose stack     at ChildProcess.emit (node:events:390:28)
84 verbose stack     at maybeClose (node:internal/child_process:1064:16)
84 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
85 verbose pkgid nunjucks@3.2.3
86 verbose cwd C:\Users\sw42\workspace\site-web\siteinnes2019
87 verbose Windows_NT 10.0.19044
88 verbose node v16.13.2
89 verbose npm  v9.1.2
90 error code 2
91 error path C:\Users\sw42\AppData\Roaming\npm\node_modules\nunjucks
92 error command failed
93 error command C:\Windows\system32\cmd.exe /d /s /c npm run build
94 error > nunjucks@3.2.3 build
94 error > npm run build:transpile && npm run build:bundle
94 error
94 error
94 error > nunjucks@3.2.3 build:transpile
94 error > babel nunjucks --out-dir .
95 error nunjucks doesn't exist
96 verbose exit 2
97 timing npm Completed in 6544ms
98 verbose unfinished npm timer reify 1669198705047
99 verbose unfinished npm timer reify:build 1669198705413
100 verbose unfinished npm timer build 1669198705418
101 verbose unfinished npm timer build:links 1669198705420
102 verbose unfinished npm timer build:run:prepare 1669198705421
103 verbose unfinished npm timer build:run:prepare:../../../AppData/Roaming/npm/node_modules/nunjucks 1669198705421
104 verbose code 2

有谁能告诉我如何解决这个问题吗?我会非常感激的。
泽维尔
我尝试使用双截棍模板设置一个环境工作区。
我希望运行命令npm link nunjucks时不会出现任何错误。

0dxa2lsx

0dxa2lsx1#

我通过删除全局环境中的双截棍修复了这个问题。

{
  "name": "website",
  "version": "1.10.10",
  "description": "website",
  "main": "build.js",
  "dependencies": {
    "elementtree": "^0.1.7",
    "fluent": "^0.11.0",
    "front-matter": "4.0.0",
    "fontoxpath": "^3.4.0",
    "fs-extra": "10.1.0",
    "glob": "^8.0.0",
    "link": "^1.5.1",
    "nunjucks": "^3.2.3",
    "nunjucks-eval": "^1.0.0",
    "nunjucks-intl": "^1.0.0",
    "showdown": "^2.1.0",
    "svgo": "^3.0.0",
    "xmldom": "^0.1.27",
    "xpath": "0.0.27"
  },
  "resolutions": {
    "nunjucks": "3.2.3"
  },
  "scripts": {
    "start": "node build.js"
  }
}

相关问题