0
我正在使用Cordova 7.0.1
以及node v7.10.1
和npm 4.2.0
和ubuntu 16.04
。Cordova創建項目錯誤:錯誤:未捕獲,未指定「錯誤」事件
但是,當我嘗試啓動一個新的項目,我得到了以下錯誤:
Error: Uncaught, unspecified "error" event. ( Error from Cordova Fetch: Error: npm: Command failed with exit code 254 Error output:
npm ERR! not a package /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js
npm ERR! addLocal Could not install /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js
npm ERR! Linux 4.10.0-28-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "/usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js"
npm ERR! node v7.10.1
npm ERR! npm v4.2.0
npm ERR! path /tmp/npm-19210-c6225b45/unpack-1e28fcae/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-19210-c6225b45/unpack-1e28fcae/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/tmp/npm-19210-c6225b45/unpack-1e28fcae/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /home/alfred/.npm/_logs/2017-07-29T09_01_02_256Z-debug.log)
而且~/.npm/_logs/2017-07-29T09_01_02_256Z-debug.log
文件:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli '/usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js
8 silly fetchOtherPackageData /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js
9 silly cache add args [ '/usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js',
9 silly cache add null ]
10 verbose cache add spec /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js
11 silly cache add parsed spec Result {
11 silly cache add raw: '/usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js',
11 silly cache add scope: null,
11 silly cache add escapedName: null,
11 silly cache add name: null,
11 silly cache add rawSpec: '/usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js',
11 silly cache add spec: '/usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js',
11 silly cache add type: 'local' }
12 silly addLocalTarball shasum (computed) 68d804862643855bd46c9138146b64789601b1da
13 verbose addTmpTarball /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js not in flight; adding
14 verbose correctMkdir /home/alfred/.npm correctMkdir not in flight; initializing
15 verbose addTmpTarball validating metadata from /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js
16 verbose tar unpack /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js
17 verbose tar unpacking to /tmp/npm-19210-c6225b45/unpack-1e28fcae
18 silly gentlyRm /tmp/npm-19210-c6225b45/unpack-1e28fcae is being purged
19 verbose gentlyRm don't care about contents; nuking /tmp/npm-19210-c6225b45/unpack-1e28fcae
20 silly gunzTarPerm modes [ '755', '644' ]
21 error not a package /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js
22 error addLocal Could not install /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js
23 silly fetchPackageMetaData Error: ENOENT: no such file or directory, open '/tmp/npm-19210-c6225b45/unpack-1e28fcae/package.json'
23 silly fetchPackageMetaData error for /usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js { Error: ENOENT: no such file or directory, open '/tmp/npm-19210-c6225b45/unpack-1e28fcae/package.json'
23 silly fetchPackageMetaData errno: -2,
23 silly fetchPackageMetaData code: 'ENOENT',
23 silly fetchPackageMetaData syscall: 'open',
23 silly fetchPackageMetaData path: '/tmp/npm-19210-c6225b45/unpack-1e28fcae/package.json' }
24 silly rollbackFailedOptional Starting
25 silly rollbackFailedOptional Finishing
26 silly runTopLevelLifecycles Finishing
27 silly install printInstalled
28 verbose stack Error: ENOENT: no such file or directory, open '/tmp/npm-19210-c6225b45/unpack-1e28fcae/package.json'
29 verbose cwd /home/alfred/.cordova/node_modules
30 error Linux 4.10.0-28-generic
31 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "/usr/lib/node_modules/cordova/node_modules/[email protected]@cordova-app-hello-world/index.js"
32 error node v7.10.1
33 error npm v4.2.0
34 error path /tmp/npm-19210-c6225b45/unpack-1e28fcae/package.json
35 error code ENOENT
36 error errno -2
37 error syscall open
38 error enoent ENOENT: no such file or directory, open '/tmp/npm-19210-c6225b45/unpack-1e28fcae/package.json'
39 error enoent ENOENT: no such file or directory, open '/tmp/npm-19210-c6225b45/unpack-1e28fcae/package.json'
39 error enoent This is most likely not a problem with npm itself
39 error enoent and is related to npm not being able to find a file.
40 verbose exit [ -2, true ]
不是這個問題,我打印的命令在另一臺機器上工作,當我打印完整的命令時,我的問題仍然存在。 –