npm

SimpleChain Dapp开发入门实例

*爱你&永不变心* 提交于 2020-08-04 10:00:08
SimpleChian技术社区最近准备举办开发挑战赛,很多社区老铁都跃跃欲试想基于SimpleChain开发Dapp应用。鉴于此种情况,本期我们就来聊一下如何基于SimpleChain开发Dapp。 下面是开发Dapp开发的详细过程,流程梳理如下: 环境准备 除了Mac电脑,还需要安装SimpleChain开发的相关环境。环境如下: nodejs truffle solidity testrpc 另外,教程中还会用到webpack,安装教程网上也有很多。这部分如果不熟悉的话请自行查阅学习下。 编写智能合约 前面我们已经安装了 truffle ,我们只需要在 电脑的项目目录下新建conference目录,进入目录执行truffle init,就可以使用truffle这个Dapp前端框架来初始化自己的项目。执行完后建立如下的子目录和文件: contracts/: 智能合约存放的目录,默认情况下已经帮你创建 Migrations.sol合约。 migrations/: 存放部署脚本 test/: 存放测试脚本 truffle.js: truffle的配置文件 修改truffle.js文件,改成如下: module.exports = { networks: { development: { host: "localhost", port: 8545, network_id: "*" //

@angular-cli install fails with deprecated request@2.88.2: request has been deprecated (mac)

时间秒杀一切 提交于 2020-08-04 04:32:28
问题 After updating node.js and npm to current LTS: node -v v12.16.0 npm -v 6.13.4 When I'm trying to install @angular-cli following the steps in the documentation, running npm install -g @angular/cli in the terminal stops the installation and the console output is: npm install -g @angular/cli npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 /Users/user/.npm-global/bin/ng -> /USERS/USER/.npm-global/lib/node_modules/@angular/cli/bin

@angular-cli install fails with deprecated request@2.88.2: request has been deprecated (mac)

筅森魡賤 提交于 2020-08-04 04:31:20
问题 After updating node.js and npm to current LTS: node -v v12.16.0 npm -v 6.13.4 When I'm trying to install @angular-cli following the steps in the documentation, running npm install -g @angular/cli in the terminal stops the installation and the console output is: npm install -g @angular/cli npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 /Users/user/.npm-global/bin/ng -> /USERS/USER/.npm-global/lib/node_modules/@angular/cli/bin

Preparing a React component to publish on npm

孤街醉人 提交于 2020-08-03 07:16:43
问题 I have a component that I want to publish in npm, I tested simply by importing it from the components folder in the project. I managed to publish it, but now I get: ERROR in ./node_modules/@ / /index.js Module parse failed: Unexpected token (11:8) You may need an appropriate loader to handle this file type. My index.js is as follows: import React from "react" import Main from "./bootstrap/containers/main" export default class BootstrapTable extends React.Component { constructor(props) { super

“composeEnhancers” is not a function in ReactJS

喜夏-厌秋 提交于 2020-08-02 08:40:08
问题 I am getting the below error in my code: TypeError: composeEnhancers is not a function const store = createStore(rootReducer, composeEnhancers( applyMiddleware(thunk) )); Can anyone see where the issue lies here? I don't understand as I have just copied my ReactJS instructor's code and he doesn't get this error, yet I do. My whole code is shown here: import React from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter } from 'react-router-dom'; import { Provider } from 'react

package.json must be actual JSON, not just JavaScript

ε祈祈猫儿з 提交于 2020-08-02 06:05:30
问题 I used http://jsonlint.com/ to check the syntax for this package.json file { "name": "hello-world", "description": "hello world test app", "version": "0.0.1", "private": true, "dependencies": { "express": “4.6.1" } } it returns the error Parse error on line 7: ... "express": “4.6.1" }} ----------------------^ Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[' not sure what is wrong with this. terminal is throwing the error for using npm install "Failed to parse package.json data.

npm posttest doesn't trigger if npm test fails

大兔子大兔子 提交于 2020-08-02 03:15:34
问题 Is there a way to trigger npm's posttest when test fails? If package.json contains "scripts": { "pretest": "echo pretest", "test": "some_failed_test_or_error", "posttest": "echo posttest" } $ npm test will echo "pretest" but not "posttest". I get the same behavior if I use mocha and a test fails, even if mocha doesn't trigger any exceptions (just some simple failure assert(true==false) ). I'm launching a resource on pretest, and I'd like to kill the resource on posttest, whether the test

socket.io sets cross-site cookie without same-site attribute

依然范特西╮ 提交于 2020-08-01 06:38:55
问题 I have a socket.io application and recently I got this warning: A cookie associated with a cross-site resource at URL was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure . You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.`

I can't install react using npx create-react-app?

牧云@^-^@ 提交于 2020-08-01 03:22:13
问题 I am trying to use npx create-react app but i have errors that is shown below: npm ERR! Unexpected end of Json input while parsing near '...eact-app/-/create-rea' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\dp\AppData\Roaming\npm-cache\_logs\2018-12-06T18-42-56-293Z-debug.log Install for create-react-app@latest failed with code 1** and the log file of the error is here...! How I can get rid of this trouble?? 0 info it worked if it ends with ok 1 verbose cli [ 'C:\

npm WARN bootstrap@4.2.1 requires a peer of jquery@1.9.1 - 3 but none is installed

限于喜欢 提交于 2020-07-31 19:04:51
问题 I tried to install bootstrap in my Angular Project by npm install --g bootstrap but i am getting following warning npm WARN bootstrap@4.2.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself. npm WARN bootstrap@4.2.1 requires a peer of popper.js@^1.14.6 but none is installed. You must install peer dependencies yourself. I am using following version of ng and npm Angular CLI: 7.1.4 Node: 10.15.0 OS: win32 x64 Angular: 7.1.4 ... animations,