我想安裝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