【问题标题】:Cloudbees Jenkins issue with Node.js Package Manager and node-sassCloudbees Jenkins 与 Node.js 包管理器和 node-sass 的问题
【发布时间】:2015-05-30 15:02:00
【问题描述】:

我目前正在尝试建立一个简单的 Jenkins 测试并在 Cloudbees 上部署一个新应用程序。目前我只是想让测试正常工作。应该配置大多数 Jenkins 设置和插件,以便它应该正确运行(Github 工作等),我已经勾选了

"Provide Node & npm bin/ folder to PATH"

复选框,因为我需要 npm 来安装一些依赖项。 Execute shell 设置有以下内容

echo $PATH    
./buildui.sh

buildui.sh 中有命令“npm install”。但是,当我运行构建时,它说 npm: command not found。我找到了this,我在取消之前的 npm-checkbox 后尝试了它。不同版本的 npm 会出现不同的问题,但我主要使用 11.8,因为它似乎是最新的。使用以下 Execute shell:

echo $PATH
curl -s -o use-node https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/node/use-node
NODE_VERSION=0.11.8 . ./use-node
npm install less
 ./buildui.sh

我收到以下错误(可以找到完整的堆栈跟踪 here

In file included from ../binding.cpp:1:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Signature> NanNew(v8::Handle<v8::FunctionTemplate>, int, v8::Handle<v8::FunctionTemplate>*)’:
../node_modules/nan/nan.h:189:78: error: no matching function for call to ‘v8::Signature::New(v8::Isolate*&, v8::Handle<v8::FunctionTemplate>&, int&, v8::Handle<v8::FunctionTemplate>*&)’

似乎是 node-sass 的问题,但是对于其他版本号,还有一些其他错误,例如

TypeError: Property 'onIncoming' of object #<HTTPParser> is not a function 
at HTTPParser.parserOnHeadersComplete (_http_common.js:110:23)

Google 只给出了这些错误的少数结果,没有一个能直接帮助我。 here 讨论了类似的问题,但它并不完全相同,也没有提供太多帮助。

我认为 Cloudbees 不提供可以更轻松地运行某些命令的 Shell 访问?任何人都知道什么可能有助于解决这个问题?谢谢:)

【问题讨论】:

    标签: node.js shell jenkins cloudbees node-sass


    【解决方案1】:

    FWIW,0.11.8 可能不是运行的安全版本。

    通过the FAQ:

    奇数版本不稳定,偶数版本稳定。 v0.2 和 v0.4 是均匀/稳定的。 v0.3 和 v0.5 是奇数/不稳定的。当前稳定的系列是 v0.10.x。下一个稳定系列将是 v0.12.x。稳定分支仅修复错误 - 它不会更改 JavaScript API、附加 API 或 ABI(在稳定分支中升级节点后无需重新构建模块)。

    我知道 NodeJS 0.10 和 0.12 之间的差异很大,所以也许这对你没有帮助,但是我在 Cloudbees 中运行 0.10.16,并且我没有 node-sass 的问题。如果 0.12.x 在 CB 中可用,我会改用它。 :(

    【讨论】:

      猜你喜欢
      • 2017-06-16
      • 1970-01-01
      • 2020-02-15
      • 2022-08-11
      • 2022-10-20
      • 2021-07-21
      • 1970-01-01
      • 2020-06-02
      • 1970-01-01
      相关资源
      最近更新 更多