首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法编译angular-fullstack堆栈生成器

无法编译angular-fullstack堆栈生成器
EN

Stack Overflow用户
提问于 2017-03-21 02:54:06
回答 1查看 200关注 0票数 0

我目前正在尝试使用angular-fullstack生成器(https://github.com/angular-fullstack/generator-angular-fullstack)启动一个项目,但我在尝试设置该项目时总是遇到错误。

我使用node v7.7.3和npm v4.4.1在Mac上运行此程序

这是我在运行"yo angular-fullstack“后得到的错误。

代码语言:javascript
复制
> iltorb@1.0.13 install /Users/USER/Desktop/forecast-me/node_modules/iltorb
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config -c import platform; print(platform.python_version());
gyp ERR! stack Usage: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--help]
gyp ERR! stack 
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:210:12)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:899:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:342:11)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at Socket.emit (events.js:191:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:513:12)
gyp ERR! System Darwin 15.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/USER/Desktop/forecast-me/node_modules/iltorb
gyp ERR! node -v v7.7.3
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok 

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iltorb@1.0.13 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the iltorb@1.0.13 install script 'node-gyp rebuild'.
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 iltorb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs iltorb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls iltorb
npm ERR! There is likely additional logging output above.

如果我继续运行"gulp“:

代码语言:javascript
复制
module.js:472
    throw err;
    ^

Error: Cannot find module 'shrink-ray'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/USER/Desktop/forecast-me/server/config/express.js:10:1)
    at Module._compile (module.js:571:32)
    at loader (/Users/USER/Desktop/forecast-me/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/USER/Desktop/forecast-me/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/USER/Desktop/forecast-me/server/app.js:24:1)
    at Module._compile (module.js:571:32)
    at loader (/Users/USER/Desktop/forecast-me/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/USER/Desktop/forecast-me/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
EN

回答 1

Stack Overflow用户

发布于 2017-07-28 21:42:56

Express服务器使用收缩射线模块在通过http发送资产之前对其进行压缩。尽管如此,收缩射线依赖于节点-zopfli模块才能正确安装。

为了让npm node-zopfli能够正确安装,npm会尝试下载一个兼容的预构建二进制文件。在失败的情况下,npm会重新构建该二进制文件。当node-gyp无法构建node-zopfli时,偶尔会出现问题。

因此,这里有一些你可以探索的路径:

  1. 尝试在linux
  2. 上安装g++之类的c++编译器,从package.json中删除对收缩射线的依赖,并在package.json文件中删除对收缩射线的引用
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42911742

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档