如何安装nodejs-websocket???
我原来装过nodejs,在nodejs的command prompt运行命令后如下:
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\Sybil\package.json'npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Sybil\package.json'npm WARN Sybil No descriptionnpm WARN Sybil No repository field.npm WARN Sybil No README datanpm WARN Sybil No license field.+ nodejs-websocket@1.7.1updated 1 package and audited 198 packages in 1.678sfound 63 vulnerabilities (24 low, 15 moderate, 24 high) run `npm audit fix` to fix them, or `npm audit` for details
执行npm audit fix后出现:
$ npm audit fixnpm ERR! code EAUDITNOPJSON npm ERR! audit No package.json found: Cannot audit a project without a package.json npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Sybil\AppData\Roaming\npm-cache\_logs\2018-11-17T14_35_56_484Z-debug.log
好吧,我把日志打开:
0 info it worked if it ends with ok
1 verbose cli [ 'E:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'audit',
1 verbose cli 'fix' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose config Skipping project config: C:\Users\Sybil/.npmrc. (matches userconfig)
5 verbose npm-session 548882a1472ad82c
6 verbose stack Error: No package.json found: Cannot audit a project without a package.json
6 verbose stack at Bluebird.all.spread (E:\Program Files\nodejs\node_modules\npm\lib\audit.js:143:19)
6 verbose stack at tryCatcher (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
6 verbose stack at Promise._settlePromiseFromHandler (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:509:35)
6 verbose stack at Promise._settlePromise (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
6 verbose stack at Promise._settlePromise0 (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
6 verbose stack at Promise._settlePromises (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
6 verbose stack at Promise._fulfill (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:638:18)
6 verbose stack at PromiseArray._resolve (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise_array.js:126:19)
6 verbose stack at PromiseArray._promiseFulfilled (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise_array.js:144:14)
6 verbose stack at PromiseArray._iterate (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise_array.js:114:31)
6 verbose stack at PromiseArray.init [as _init] (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise_array.js:78:10)
6 verbose stack at Promise._settlePromise (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:566:21)
6 verbose stack at Promise._settlePromise0 (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
6 verbose stack at Promise._settlePromises (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
6 verbose stack at Promise._fulfill (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:638:18)
6 verbose stack at PromiseArray._resolve (E:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise_array.js:126:19)
7 verbose cwd C:\Users\Sybil
8 verbose Windows_NT 10.0.17134
9 verbose argv "E:\\Program Files\\nodejs\\node.exe" "E:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "audit" "fix"
10 verbose node v8.12.0
11 verbose npm v6.4.1
12 error code EAUDITNOPJSON
13 error audit No package.json found: Cannot audit a project without a package.json
14 verbose exit [ 1, true ]
好像是说找不到package.json。。我也装过git,用git bash运行也是一样,windows的cmd运行也是一样。。