node.js - 呃! OMG ENOENT : no such file or directory, uv_chdir 安装 pocketsphinx Node 模块时

标签 node.js npm pocketsphinx

我正在尝试安装 Node 模块 pocketsphinx,但在安装时出现错误:

ERR! OMG ENOENT: no such file or directory, uv_chdir

我当然明白这意味着什么,但我不知道该怎么做。 如果这有帮助,我正在使用:

Ubuntu 16.10,
Node v8.1.4,
cmake 3.5.2,
npm 5.0.3。

终端输出:

jonas@jonas-laptop:~$ sudo npm install -g pocketsphinx

> pocketsphinx@5.0.7 install /usr/local/lib/node_modules/pocketsphinx
> cmake-js compile

info TOOL Using Unix Makefiles generator.
info TOOL Using c++11 compiler standard.
info CMD CONFIGURE
WARN invalid config loglevel="notice"
info REP Build has been failed, trying to do a full rebuild.
info CMD CLEAN
info RUN cmake -E remove_directory "/usr/local/lib/node_modules/pocketsphinx/build"
info CMD CONFIGURE
ERR! OMG ENOENT: no such file or directory, uv_chdir
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pocketsphinx@5.0.7 install: `cmake-js compile`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pocketsphinx@5.0.7 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jonas/.npm/_logs/2017-07-12T19_03_21_852Z-debug.log
jonas@jonas-laptop:~$ 

和错误日志:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'pocketsphinx' ]
2 info using npm@5.0.3
3 info using node@v8.1.4
4 verbose npm-session 32c7a47cae361b7d
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 https://registry.npmjs.org/pocketsphinx 1028ms (from cache)
8 silly pacote tag manifest for pocketsphinx@latest fetched in 1234ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly install loadAllDepsIntoIdealTree
13 silly resolveWithNewModule pocketsphinx@5.0.7 checking installable status
14 silly currentTree lib
15 silly idealTree lib
15 silly idealTree └── pocketsphinx@5.0.7
16 silly install generateActionsToTake
17 silly diffTrees action count 1
18 silly diffTrees add pocketsphinx@5.0.7
19 silly decomposeActions action count 8
20 silly decomposeActions fetch pocketsphinx@5.0.7
21 silly decomposeActions extract pocketsphinx@5.0.7
22 silly decomposeActions preinstall pocketsphinx@5.0.7
23 silly decomposeActions build pocketsphinx@5.0.7
24 silly decomposeActions install pocketsphinx@5.0.7
25 silly decomposeActions postinstall pocketsphinx@5.0.7
26 silly decomposeActions finalize pocketsphinx@5.0.7
27 silly decomposeActions refresh-package-json pocketsphinx@5.0.7
28 silly install executeActions
29 silly doSerial global-install 8
30 verbose correctMkdir /home/jonas/.npm/_locks correctMkdir not in flight; initializing
31 verbose lock using /home/jonas/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
32 silly doParallel extract 8
33 silly extract pocketsphinx@5.0.7
34 silly pacote trying pocketsphinx@https://registry.npmjs.org/pocketsphinx/-/pocketsphinx-5.0.7.tgz by hash: sha1-dUwktQehepSJPiB7kAzI1mRV6EM=
35 silly pacote pocketsphinx@https://registry.npmjs.org/pocketsphinx/-/pocketsphinx-5.0.7.tgz extracted to /usr/local/lib/node_modules/.staging/pocketsphinx-f65a58b7 by content address 90ms
36 silly doReverseSerial remove 8
37 silly doSerial move 8
38 silly doSerial finalize 8
39 silly finalize /usr/local/lib/node_modules/pocketsphinx
40 silly doParallel refresh-package-json 8
41 silly refresh-package-json /usr/local/lib/node_modules/pocketsphinx
42 silly doParallel preinstall 8
43 silly preinstall pocketsphinx@5.0.7
44 info lifecycle pocketsphinx@5.0.7~preinstall: pocketsphinx@5.0.7
45 silly lifecycle pocketsphinx@5.0.7~preinstall: no script for preinstall, continuing
46 silly doSerial build 8
47 silly build pocketsphinx@5.0.7
48 info linkStuff pocketsphinx@5.0.7
49 silly linkStuff pocketsphinx@5.0.7 has /usr/local/lib/node_modules as its parent node_modules
50 silly linkStuff pocketsphinx@5.0.7 is part of a global install
51 silly linkStuff pocketsphinx@5.0.7 is installed into a global node_modules
52 silly linkStuff pocketsphinx@5.0.7 is installed into the top-level global node_modules
53 verbose linkBins pocketsphinx@5.0.7
54 verbose linkMans pocketsphinx@5.0.7
55 silly doSerial global-link 8
56 silly doParallel update-linked 8
57 silly doSerial install 8
58 silly install pocketsphinx@5.0.7
59 info lifecycle pocketsphinx@5.0.7~install: pocketsphinx@5.0.7
60 verbose lifecycle pocketsphinx@5.0.7~install: unsafe-perm in lifecycle false
61 verbose lifecycle pocketsphinx@5.0.7~install: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/local/lib/node_modules/pocketsphinx/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
62 verbose lifecycle pocketsphinx@5.0.7~install: CWD: /usr/local/lib/node_modules/pocketsphinx
63 silly lifecycle pocketsphinx@5.0.7~install: Args: [ '-c', 'cmake-js compile' ]
64 silly lifecycle pocketsphinx@5.0.7~install: Returned: code: 1  signal: null
65 info lifecycle pocketsphinx@5.0.7~install: Failed to exec install script
66 verbose unlock done using /home/jonas/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
67 verbose stack Error: pocketsphinx@5.0.7 install: `cmake-js compile`
67 verbose stack Exit status 1
67 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:283:16)
67 verbose stack     at emitTwo (events.js:125:13)
67 verbose stack     at EventEmitter.emit (events.js:213:7)
67 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
67 verbose stack     at emitTwo (events.js:125:13)
67 verbose stack     at ChildProcess.emit (events.js:213:7)
67 verbose stack     at maybeClose (internal/child_process.js:897:16)
67 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
68 verbose pkgid pocketsphinx@5.0.7
69 verbose cwd /home/jonas
70 verbose Linux 4.8.0-58-generic
71 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "pocketsphinx"
72 verbose node v8.1.4
73 verbose npm  v5.0.3
74 error code ELIFECYCLE
75 error errno 1
76 error pocketsphinx@5.0.7 install: `cmake-js compile`
76 error Exit status 1
77 error Failed at the pocketsphinx@5.0.7 install script.
77 error This is probably not a problem with npm. There is likely additional logging output above.
78 verbose exit [ 1, true ]

最佳答案

安装之前,检查任何 Node 服务是否正在运行或是否有任何内容正在监视 node_modules 文件夹。在 Windows 中,Visual Studio Code 阻止安装,一旦我关闭 VS Code,它就会安装。 请引用以下: https://github.com/npm/npm/issues/17444

关于node.js - 呃! OMG ENOENT : no such file or directory, uv_chdir 安装 pocketsphinx Node 模块时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45066140/

相关文章:

node.js - socket.io.js 应该返回一个空文件吗?

node.js - 如何访问部署在aws elasticbeanstalk中的文件

grammar - 一个 JSGF 文件是否只使用一个公共(public)规则?

mysql - 同型号多个外键问题

javascript - NodeJS 将额外参数传递给回调

node.js - npm install -g <package> 错误 EADDRINUSE

javascript - 使用 xml-builder Node 模块打印尖括号时出现问题

reactjs - 我无法解决的一些依赖关系问题

java - 如何在android中使用pocketsphinx进行多个关键字激活而无需进入菜单

python - 检查里面的for循环没有执行