连帽衫postinstall失败:process.env.PWD未定义

时间:2017-06-04 15:52:42

标签: windows-10 npm-install hoodie

我正在尝试连帽衫,但是npm安装对我不起作用。

Windows 10 节点7.0.0 NPM 3.10.8

npm ERR! hoodie@28.1.2 postinstall: `node ./bin/setup.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hoodie@28.1.2 postinstall script 'node ./bin/setup.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hoodie package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/setup.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs hoodie
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls hoodie
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     F:\dev\mrkennedy-ca\countby\npm-debug.log
F:\dev\mrkennedy-ca\countby [gh-pages +0 ~3 -0]> node -v
v7.0.0
F:\dev\mrkennedy-ca\countby [gh-pages +0 ~3 -0]> npm -v
3.10.8

问题在于安装后脚本,具体而言,process.env.PWD未定义,但脚本正在尝试访问它:

> hoodie@28.1.2 postinstall F:\dev\mrkennedy-ca\countby\node_modules\hoodie
> node ./bin/setup.js

F:\dev\mrkennedy-ca\countby\node_modules\hoodie\bin\setup.js:7
var installIntoApp = process.env.PWD.indexOf('node_modules') !== -1
                                ^

TypeError: Cannot read property 'indexOf' of undefined
at Object.<anonymous> (F:\dev\mrkennedy-ca\countby\node_modules\hoodie\bin\setup.js:7:37)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.runMain (module.js:607:10)
at run (bootstrap_node.js:382:7)
at startup (bootstrap_node.js:137:9)
at bootstrap_node.js:497:3

么?此安装位于现有软件包中,但在quickstart directions中尝试在新软件包上安装时,我得到相同的结果。

1 个答案:

答案 0 :(得分:1)

这是由一天前通过https://github.com/hoodiehq/hoodie/pull/760发布的更改引起的。我创建了一个问题,您可以按照该问题在问题解决时收到通知:https://github.com/hoodiehq/hoodie/issues/763

目前,请尝试安装以前版本的npm install --save hoodie@28.1.1