突然在我的一个jenkins环境中构建已经开始失败,而在本地机器上它似乎工作正常,因为我安装了python,
从日志中我能够检测到问题是内部依赖,即来自node-sass v3.8.0的node-gyp v3.5.0,当我通过访问这个关于node- gyp的研究并发现需要安装Python的先决条件时.
所以我的问题是我可以安装什么版本的node-sass来绕过这个或者是否有更好的解决方案,因为我的构建在今天早上运行正常,在同一环境中.
节点v5.10.1
错误日志
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (C:\Program Files (x86)\Jenkins\jobs\NdbSite-hot-fix-Manual-PreBuild\workspace\src\NdbSite.UI\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (C:\Program Files (x86)\Jenkins\jobs\NdbSite-hot-fix-Manual-PreBuild\workspace\src\NdbSite.UI\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (C:\Program Files (x86)\Jenkins\jobs\NdbSite-hot-fix-Manual-PreBuild\workspace\src\NdbSite.UI\node_modules\which\which.js:80:29)
gyp verb `which` failed at C:\Program Files (x86)\Jenkins\jobs\NdbSite-hot-fix-Manual-PreBuild\workspace\src\NdbSite.UI\node_modules\which\which.js:89:16
gyp verb `which` failed at C:\Program Files (x86)\Jenkins\jobs\NdbSite-hot-fix-Manual-PreBuild\workspace\src\NdbSite.UI\node_modules\isexe\index.js:44:5
gyp verb `which` failed …Run Code Online (Sandbox Code Playgroud) 有没有办法在本机应用程序中使用 scss 文件?我只是好奇并且对 react-native 应用程序架构没有太多了解,但是我想使用我当前的项目 scss 文件来处理我们计划构建的新 react-native-android 项目。
反应原生版本:“0.46.4”
反应版本:“16.0.0-alpha.12”
BABEL-PRESET-REACT-NATIVE:“2.1.0”
更新 :
我搜索了一点发现css-to-react-native这有点让我将我的 css 转换为 react-native 样式表对象,对我来说有点解决方法。
谢谢。
我需要访问内部组件的状态,使其对click事件有效,我的问题是Enzyme在使用时不允许这种情况mount,这只能通过shallow渲染这里提到的酶来实现,也如我所提到的那样使用潜水来获取Form组件并再次从Form获取我需要访问的Button组件,问题是我的测试用例因Form组件长度为零而继续失败.
酶:3.1.0
酶适配子反应-15:1.0.1"
我对Enzyme很新,任何帮助将不胜感激,谢谢
contactus.test.js:
test('It should simulate submit action ', ()=>{
let contactUs = shallow(<ContactUs />);
sinon.spy(ContactUs.prototype, 'submitMessage');// Verify this method call
let form = contactUs.find(Form)
expect(form.length).toBe(1);//Failing over here
let button = form.dive().find(Button);
expect(button.length).toBe(1);
button.setState({disabled : false});//Need to achieve this
expect(button).toBeDefined();
expect(button.length).toBe(1);
expect(button.props().label).toBe('SEND MESSAGE');
button.find('a').get(0).simulate('click');
expect(ContactUs.prototype.submitMessage).toHaveProperty('callCount',
1);
});
Run Code Online (Sandbox Code Playgroud)
contactus.js:
import React, {Component,PropTypes} from 'react';
import Form from './form';
import {sendSubscriptionMessage} from '../../network';
import Button from '../Fields/Button';
export …Run Code Online (Sandbox Code Playgroud) enzyme ×1
javascript ×1
jestjs ×1
node-gyp ×1
node-sass ×1
node.js ×1
react-native ×1
reactjs ×1
w3c ×1