我试图在Ubuntu上安装MEAN-CLI,使用以下命令:
sudo npm install -g mean-cli
。我得到这个:
mean-cli@0.10.14 preinstall /home/marcelo/projects/node_modules/mean-cli
node ./scripts/preinstall
npm WARN deprecated json-file-plus@2.0.0: Before v3.0.0, errors in fs.writeFile would not be propagated
> mean-health@0.1.7 postinstall /home/marcelo/projects/node_modules/mean-cli/node_modules/mean-health
> node ./postinstall.js
> bson-ext@0.1.13 install /home/marcelo/projects/node_modules/mean-cli/node_modules/mongoose/node_modules/bson/node_modules/bson-ext
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/home/marcelo/projects/node_modules/mean-cli/node_modules/mongoose/node_modules/bson/node_modules/bson-ext/build'
CXX(target) Release/obj.target/bson/ext/bson.o
SOLINK_MODULE(target) Release/obj.target/bson.node
COPY Release/bson.node
make: Leaving directory '/home/marcelo/projects/node_modules/mean-cli/node_modules/mongoose/node_modules/bson/node_modules/bson-ext/build'
> kerberos@0.0.15 install /home/marcelo/projects/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)
make: Entering directory '/home/marcelo/projects/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/build'
CXX(target) Release/obj.target/kerberos/lib/kerberos.o
CXX(target) Release/obj.target/kerberos/lib/worker.o
CC(target) Release/obj.target/kerberos/lib/kerberosgss.o
../lib/kerberosgss.c:36:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
#pragma clang diagnostic push ^
../lib/kerberosgss.c:37:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
^
../lib/kerberosgss.c: In function ‘authenticate_gss_client_wrap’:
../lib/kerberosgss.c:362:19: warning: variable ‘server_conf_flags’ set but not used [-Wunused-but-set-variable]
char buf[4096], server_conf_flags;
^
../lib/kerberosgss.c: At top level:
../lib/kerberosgss.c:930:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
CC(target) Release/obj.target/kerberos/lib/base64.o
CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
SOLINK_MODULE(target) Release/obj.target/kerberos.node
/usr/bin/ld: cannot find -lkrb5
/usr/bin/ld: cannot find -lgssapi_krb5
collect2: error: ld returned 1 exit status
kerberos.target.mk:130: recipe for target 'Release/obj.target/kerberos.node' failed
make: *** [Release/obj.target/kerberos.node] Error 1
make: Leaving directory '/home/marcelo/projects/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.19.0-30-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/marcelo/projects/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
mean-cli@0.10.14 ../node_modules/mean-cli
├── opener@1.4.1
├── async-series@0.0.1
├── progress@1.1.8
├── crypto@0.0.3
├── shelljs@0.3.0
├── commander@2.9.0 (graceful-readlink@1.0.1)
├── lodash@2.4.2
├── mean-health@0.1.7
├── chalk@0.5.1 (ansi-styles@1.1.0, escape-string-regexp@1.0.3, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
├── json-file-plus@2.0.0 (is@2.0.2, node.extend@1.1.5, promiseback@2.0.2)
├── inquirer@0.8.5 (ansi-regex@1.1.1, figures@1.4.0, cli-width@1.0.1, through@2.3.8, chalk@1.1.1, readline2@0.1.1, lodash@3.10.1, rx@2.5.3)
├── request@2.65.0 (aws-sign2@0.6.0, forever-agent@0.6.1, caseless@0.11.0, stringstream@0.0.4, oauth-sign@0.8.0, tunnel-agent@0.4.1, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, node-uuid@1.4.3, form-data@1.0.0-rc3, qs@5.2.0, tough-cookie@2.2.0, combined-stream@1.0.5, mime-types@2.1.7, http-signature@0.11.0, hawk@3.1.0, bl@1.0.0, har-validator@2.0.2)
├── prompt@0.2.14 (revalidator@0.1.8, pkginfo@0.3.0, read@1.0.7, winston@0.8.3, utile@0.2.1)
├── npm@2.14.8
└── mongoose@4.0.8 (regexp-clone@0.0.1, sliced@0.0.5, muri@1.0.0, hooks-fixed@1.0.2, mpromise@0.5.4, kareem@1.0.1, mpath@0.1.1, async@0.9.0, ms@0.1.0, mquery@1.6.1, bson@0.3.2, mongodb@2.0.34)
然后当我试图运行:
mean init yourNewApp
它说命令'mean'不存在,可能是因为上面的错误。有人能帮帮我吗?I'm new to mean-cli.
npm update -g npm
npm update -g grunt-cli
npm update -g wer
可能是你的包需要更新,就像我的情况一样
我还忘记了之前做的一个步骤
安装libkrb5-dev
这将安装kerbores开发文件,这是您的脚本失败的地方