我想安装jhipster来运行我已经克隆在/ home/thomas/Documents/softeng/project/CS673-Project中的版本库。我无法解析丢失的东西。我运行的命令是sudo npm install -g generator-jhipster。 下面我已经包含了日志的完整相关部分。在ubuntu上安装generator-jhipster与npm时出错16
11518 silly install [email protected]
11519 info lifecycle [email protected]~install: [email protected]
11520 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle false
11521 verbose lifecycle [email protected]~install: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/local/lib/node_modules/generator-jhipster/node_modules/.bin:/usr/local/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
11522 verbose lifecycle [email protected]~install: CWD: /usr/local/lib/node_modules/generator-jhipster
11523 silly lifecycle [email protected]~install: Args: [ '-c', 'tabtab install --name jhipster --auto' ]
11524 silly lifecycle [email protected]~install: Returned: code: 1 signal: null
11525 info lifecycle [email protected]~install: Failed to exec install script
11526 verbose unlock done using /home/thomas/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
11527 verbose stack Error: [email protected] install: `tabtab install --name jhipster --auto`
11527 verbose stack Exit status 1
11527 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:283:16)
11527 verbose stack at emitTwo (events.js:87:13)
11527 verbose stack at EventEmitter.emit (events.js:172:7)
11527 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
11527 verbose stack at emitTwo (events.js:87:13)
11527 verbose stack at ChildProcess.emit (events.js:172:7)
11527 verbose stack at maybeClose (internal/child_process.js:821:16)
11527 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
11528 verbose pkgid [email protected]
11529 verbose cwd /home/thomas/Documents/softeng/project/CS673-Project
11530 verbose Linux 4.4.0-53-generic
11531 verbose argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install" "-g" "generator-jhipster"
11532 verbose node v4.2.6
11533 verbose npm v5.0.3
11534 error code ELIFECYCLE
11535 error errno 1
11536 error [email protected] install: `tabtab install --name jhipster --auto`
11536 error Exit status 1
11537 error Failed at the [email protected] install script.
11537 error This is probably not a problem with npm. There is likely additional logging output above.
11538 verbose exit [ 1, true ]
谢谢你这么多
但是你为什么要用'sudo'来安装全局依赖? – vsenko
嘿@vsenko,不是我真的很在乎这个。也许我在我的评论中不是很清楚,但是我遵循[jhipster的安装配方](https://jhipster.github.io/installation/),我认为安装过程会非常简单直到我没有非常熟悉npm或nodejs。 –
谢谢你的链接Reginaldo! 'sudo chown -R $(whoami)$(npm config获取前缀)/ {lib/node_modules,bin,share}' 这个命令有窍门! – Unbekannt