0

我正在尝试使用连帽衫,但 npm install 对我不起作用。

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

建议?此安装在现有包内,但在新包上尝试安装时,我得到了与快速入门说明中相同的结果。

4

1 回答 1

1

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

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

于 2017-06-04T16:05:49.167 回答