GithubHelp home page GithubHelp logo

truffle-box / pet-shop-box Goto Github PK

View Code? Open in Web Editor NEW
203.0 203.0 143.0 793 KB

A box containing all you need to get started with our Pet Shop tutorial.

License: MIT License

JavaScript 98.88% HTML 0.96% Solidity 0.16%

pet-shop-box's People

Contributors

adrianmcli avatar benjamincburns avatar bmmpxf avatar cds-amal avatar cgcardona avatar cruzmolina avatar dependabot[bot] avatar eggplantzzz avatar jeongseup avatar onlyonejmjq avatar tcoulter avatar teixas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pet-shop-box's Issues

Assert.sol and DeployedAddresses.sol files are not found

Hi, I am following the pet shop tutorial as mentioned there. But when i am trying to run test then it shows me the following errors! And I can not run the test properly. Any suggestion??

c:/trufflePet/truffleDemo/test/TestAdoption.sol:3:1: ParserError: Source "truffle/Assert.sol" not found: File not supplied initially. import "truffle/Assert.sol"; ^--------------------------^

c:/trufflePet/truffleDemo/test/TestAdoption.sol:4:1: ParserError: Source "truffle/DeployedAddresses.sol" not found: File not supplied initially. import "truffle/DeployedAddresses.sol"; ^-------------------------------------^

I am getting the following error from truffle unbox

D:\Dev\Ethereum\contest>truffle unbox pet-shop

Starting unbox...

√ Preparing to download box
× Downloading
Unbox failed!
× Downloading
Unbox failed!
RequestError: Error: getaddrinfo ENOENT raw.githubusercontent.com
at new RequestError (C:\Users\Younas\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request-promise-native\node_modules\request-promise-core\lib\errors.js:14:1)
at Request.plumbing.callback (C:\Users\Younas\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request-promise-native\node_modules\request-promise-core\lib\plumbing.js:87:1)
at Request.RP$callback [as _callback] (C:\Users\Younas\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request-promise-native\node_modules\request-promise-core\lib\plumbing.js:46:1)
at self.callback (C:\Users\Younas\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request\request.js:185:1)
at Request.emit (events.js:315:20)
at Request.onRequestError (C:\Users\Younas\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\request\request.js:881:1)
at ClientRequest.emit (events.js:315:20)
at TLSSocket.socketErrorListener (_http_client.js:469:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Truffle v5.3.2 (core: 5.3.2)
Node v14.16.0

Test - "before all" hook: prepare suite - out of gas.

Any ideas?

truffle version
Truffle v5.0.0-beta.2 (core: 5.0.0-beta.2)
Solidity v0.5.0 (solc-js)
Node v10.13.0

truffle(develop)> test
Using network 'develop'.

Compiling ./test/TestAdoption.sol...


  TestAdoption
    1) "before all" hook: prepare suite


  0 passing (2s)
  1 failing

  1) TestAdoption
       "before all" hook: prepare suite:
     Error: while migrating Assert: Returned error: VM Exception while processing transaction: out of gas
      at /usr/lib/node_modules/truffle/build/webpack:/packages/truffle-deployer/src/deployment.js:364:1
      at process._tickCallback (internal/process/next_tick.js:68:7)



1
truffle(develop)> 
/usr/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/lib/utils.js:200
      throw new Error(error);
^
Error: TestAdoption contains unresolved libraries. You must deploy and link the following libraries before you can deploy a new version of TestAdoption: Assert
    at Function.checkLibraries (/usr/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/lib/utils.js:200:1)
    at constructor.detectNetwork.then.network (/usr/lib/node_modules/truffle/build/webpack:/packages/truffle-contract/lib/contract.js:181:1)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Error Downloading Box and Error while init.

# truffle unbox pet-shop
Downloading...
Error: Truffle Box at URL https://github.com/truffle-box/pet-shop-box doesn't exist. If you believe this is an error, please contact Truffle support.
    at Request._callback (/usr/lib/node_modules/truffle/build/webpack:/packages/truffle-box/lib/utils/unbox.js:50:1)
    at Request.self.callback (/usr/lib/node_modules/truffle/build/webpack:/~/request/request.js:185:1)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/usr/lib/node_modules/truffle/build/webpack:/~/request/request.js:1157:1)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/usr/lib/node_modules/truffle/build/webpack:/~/request/request.js:1079:1)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)

Truffle unbox pet-shop error

While I was trying to unbox the truffle pet shop using "Truffle unbox pet-shop" it is continuously showing the error that it doesn't exist there to unbox
How can I fix that issue on the Ubuntu terminal?

Error: Could not find artifacts

Hi all!

Im running on:
Windows 10 Enterprise
Truffle v4.1.5 (core: 4.1.5)
Solidity v0.4.21 (solc-js)

I'm following the pet-shop example and everything goes well untill I run:
truffle.cmd test

Then I get:
Compiling .\contracts\Adoption.sol...
Compiling .\test\TestAdoption.sol...
Compiling truffle/Assert.sol...
Compiling truffle/DeployedAddresses.sol...

But then:

TestAdoption
1) "before all" hook: prepare suite

0 passing (3s)
1 failing

  1. TestAdoption "before all" hook: prepare suite:
    Error: Could not find artifacts for /C/Users/adria.aguillo/pet-shop-tutorial/contracts/Adoption.sol from any sources
    at Resolver.require (C:\Users\adria.aguillo\AppData\Roaming\npm\node_modules\truffle\build\webpack:~\truffle-resolver\index.js:37:1)
    ...
    ...

How could I fix this?

Thank you very much

Pets show up as "Success" when they have not been adopted.

Steps to reperform:
Click "Adopt Pet"
Click "Reject" when metamask prompt appears
Refresh Webpage

I am using Chrome, Metamask on MAC.

When Reject is pressed: Following console error appears:

Error: MetaMask Tx Signature: User denied transaction signature.
at TransactionStateManger. (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:2214:39)

Prior to the page being refreshed - you can click "Adopt Pet", confirm the transaction, and the pet should be successfully adopted.

Source "truffle/Assert.sol" not found

While trying to compile the TestAdoption.sol part of the tutorial, I come across this issue.

the code is:

pragma solidity ^0.4.17;

import "truffle/Assert.sol";
import "truffle/DeployedAddress.sol";
import "../contracts/Adoption.sol";

contract TestAdoption{
Adoption adoption= Adoption(DeployedAddresses.Adoption());
}

got this when tried truffle unbox pet-shop

sha1-ZApTfBgGiTA9W+krxHa568RBwLw= integrity checksum failed when using sha1: wanted sha1-ZApTfBgGiTA9W+krxHa568RBwLw= but got sha1-xsXUqHv6v6lH+0bIRHmjaGeQTEg=. (48730 bytes)

metamask can't connect http://localhost:9545

OS: ubuntu-16.04
Truffle v4.0.3 (core: 4.0.3)
Solidity v0.4.18 (solc-js)

I am following the tutorial here: http://truffleframework.com/tutorials/pet-shop.

At first,
when I tried truffle develop, that connects to localhost:9545.
Followed the tutorial, though I tried connecting metamask http://localhost:9545, and http://127.0.0.1:9545, that wasn't able to connect "Connecting to Unknown Private Network".

Second,
I tried changing the configuration file, "truffle.js"

module.exports = {  
  // See <http://truffleframework.com/docs/advanced/configuration>  
  // for more about customizing your Truffle configuration!  
  networks: {  
    development: {  
      host: "127.0.0.1",  
      port: 7545,  
      network_id: "*" // Match any network id  
    }  
  }  
};

As a result, I can connect metamask's private network "http://127.0.0.1:7545"
However, as I did truffle develop, that network is "localhost:9545" though I changed truffle.js.
And then, I did truffle compile and migrate, there happened the error "Could not connect to your Ethereum client. Please check that your Ethereum client:

- is running
- is accepting RPC connections (i.e., "--rpc" option is used in geth)
- is accessible over the network
- is properly configured in your Truffle configuration file (truffle.js)

Strange "hook" error

Any idea what the problem is, or how I debug?

: truffle test
Using network 'development'.

Compiling ./contracts/Adoption.sol...
Compiling ./test/TestAdoption.sol...


  TestAdoption
    1) "before all" hook: prepare suite


  0 passing (20s)
  1 failing

  1) TestAdoption
       "before all" hook: prepare suite:
     Error: while migrating TestAdoption: Returned error: VM Exception while processing transaction: revert
      at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-deployer/src/deployment.js:364:1
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)


This is the Ganache log, it says "revert" but no reason why:

[17:24:46]   Transaction: 0xd4f8e47ef6f02036d3880512ffe64545ce08b5e85cc28f2408242efaee272add
[17:24:46]   Contract created: 0x4e96714cc6c51e9b673ec09701e12ac3e27fb9b2
[17:24:46]   Gas usage: 190068
[17:24:46]   Block Number: 16
[17:24:46]   Block Time: Wed Jan 30 2019 17:24:44 GMT+0000 (GMT)
[17:24:46] eth_getTransactionReceipt
[17:24:46] eth_getCode
[17:24:46] eth_getBlockByNumber
[17:24:46] eth_getBlockByNumber
[17:24:46] eth_getBlockByNumber
[17:24:46] eth_estimateGas
[17:24:46] eth_getBlockByNumber
[17:24:46] eth_blockNumber
[17:24:46] eth_sendTransaction
[17:24:46]   Transaction: 0x2995d64ec8cff5018e91e99cf9fb850a4fb3153575e539de2b31998835907c1c
[17:24:46]   Contract created: 0xc43cc30198cf91e1f791bb1d29582e12ada1ceb7
[17:24:46]   Gas usage: 189480
[17:24:46]   Block Number: 17
[17:24:46]   Block Time: Wed Jan 30 2019 17:24:45 GMT+0000 (GMT)
[17:24:46]   Runtime Error: revert
[17:24:46] eth_call
[17:24:46] eth_getBlockByNumber

There is no "Adopt" button

Hi,
Everything works great but the webpage shows only "Success" buttons (see attached). Please point me to the right direction.
Thanks,
-5ong
sshot1

Metamask window goes into loading stage

Hi,

I followed the tutorial and I was able to compile and migrate the Dapp. When I authorize the transaction by clicking on submit, then notification window of metamask goes into loading status forever.

Following is the screenshot for the same. Is there anything I'm doing wrong?

image

Promise not resolving after transaction has been mined

When you click on submit, the button label won't turn to "success" unless you refresh the page.
This happens when running locally using truffle develop or Ganache.
This does however work when deployed to a testnet like Ropsten

DownloadingError: read ECONNRESET at TLSWrap.onStreamRead (internal/stream_base_commons.js:201:27)

Ubuntu 18.04.

Truffle v5.1.2 (core: 5.1.2)

Solidity v0.5.12 (solc-js)

Node v13.2.0

Web3.js v1.2.2


When I execute truffle unbox pet-shop on terminal, I get error

✔ Preparing to download
⠼ DownloadingError: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:201:27)

I am expecting contents of directory to look like this (from https://www.dappuniversity.com/articles/the-ultimate-ethereum-dapp-tutorial)

expected

But instead it looks like this

unwanted_output

Command not found

Truffle install seems to work just fine, but the unboxing command is not responding, any ideas?
Screen Shot 2019-03-28 at 11 23 52 AM

re: issue with first compile

Not sure what the issue is....

truffle compile

Compiling ./contracts/Adoption.sol...
Compiling ./contracts/Migrations.sol...

Compilation warnings encountered:

/home/ubuntu/eth_projects/PetShop/contracts/Migrations.sol:11:3: Warning: No visibility specified. Defaulting to "public".
function Migrations() {
^
Spanning multiple lines.
,/home/ubuntu/eth_projects/PetShop/contracts/Migrations.sol:15:3: Warning: No visibility specified. Defaulting to "public".
function setCompleted(uint completed) restricted {
^
Spanning multiple lines.
,/home/ubuntu/eth_projects/PetShop/contracts/Migrations.sol:19:3: Warning: No visibility specified. Defaulting to "public".
function upgrade(address new_address) restricted {
^
Spanning multiple lines.

/home/ubuntu/eth_projects/PetShop/contracts/Migrations.sol:11:3: Warning: No visibility specified. Defaulting to "public".
function Migrations() {
^
Spanning multiple lines.
,/home/ubuntu/eth_projects/PetShop/contracts/Migrations.sol:15:3: Warning: No visibility specified. Defaulting to "public".
function setCompleted(uint completed) restricted {
^
Spanning multiple lines.
,/home/ubuntu/eth_projects/PetShop/contracts/Migrations.sol:19:3: Warning: No visibility specified. Defaulting to "public".
function upgrade(address new_address) restricted {
^
Spanning multiple lines.
,/home/ubuntu/eth_projects/PetShop/contracts/Adoption.sol:8:11: DeclarationError: Undeclared identifier.
require(petID >= 0 && petID <=15) ;
^---^

Compilation failed. See above.

Here is my system: Ubuntu 16.04
sudo npm -v
5.6.0

sudo nodejs -v
v9.3.0

echo $PATH
/home/ubuntu/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ubuntu/eth_projects/PetShop

pwd
/home/ubuntu/eth_projects/PetShop/

more /contracts/Adoption.sol
pragma solidity ^0.4.17;

contract Adoption {
address[16] public adopters;

// Adopting a pet
function adopt(uint petId) public returns (uint) {
require(petID >= 0 && petID <=15) ;

adopters[petID] = msg.sender;

return petId;
}

// Retrieving the adopters
function getAdopters() public view returns (address[16]) {
return adopters;
}

}

Price by adoption

Thanks for your job. It helps a lot to understand the operation of truffle.
In my case I am tested in a private network of quorum. I would like to know how instead of "adopt" I can pay?

For example, I want buy Frieda to cost 3 ethers, and when I adopt it, I can take it from my account to enter it into the seller's account.
Is there an example payable of this style?
Thank you

Running truffle test command do some loop with strange caracters


Issue

Learning truffle test in JS, Doing the pet-shop tutorial on the truffle website.
Everything was ok (ganache running, compilation contract success, migration down), but when i run "truffle test" command, my terminal showing strange caracters in loop. Can't find solution on internet...
I reproduce on windows and mac. I tried to use different version of nodeJs/truffle but not solve it.

Steps to Reproduce

Run truffle test command

Expected Behavior

The command should show the unit tests result.

Actual Results

I redirect the output of the truffle test command to see whats happened, and this is the result :
Capture d’écran 2022-01-09 à 11 46 56

The command didn't finish itself, i need to stop it. I have a log about 1,5Go for a run about 30s.

Environment

  • Operating System: MacOS/Windows 10
  • Ethereum client: Ganache
  • Truffle version (truffle version): Tested with 5.4.25 and 5.4.27
  • node version (node --version): Tested with 12.8.22 and 14.18.1
  • npm version (npm --version): 8.3.0

I opened an issue on pet-shop boxe repository too...

Thanks in advance for hep !

i try in pst-shop use the token in tutorialtoken

i meet error how to use tutorialtoken token in pst-shop
i try but error

pragma solidity ^0.4.17;
contract TTtoken {
function balanceOf(address addr) public returns (uint256);
}

contract Adoption {
address[16] public adopters;
TTtoken mainDAO = TTtoken(0x2c2b9c9a4a25e24b174f26114e8926a9f2128fe4);

// Adopting a pet

function adopt(uint petId) public returns (uint) {
require(petId >= 0 && petId <= 15);

adopters[petId] = msg.sender;

return petId;

}

// Retrieving the adopters

function getAdopters() public view returns (address[16]) {
return adopters;
}

  // Retrieving the adopters

function getMytokenbalanceOf(address _owner) public view returns (uint256) {
uint256 balance = mainDAO.balanceOf(_owner);
return balance;

}

}

Adopt button issue

So I have been trying to get the app to work for a while now, but keep running into an issue when I push the adopt button. The logs show that the contract file adoption.json is not found. The error messages from browser console are below. I solved the errors by moving my contracts folder from build/contracts directly to src and then specified the path to the adoption.json file. Any idea why this is happening? I guess that even though the fix works, this really is not the way it's supposed to work, as the example file did not need to specify any location specifications. I'm working with rinkeby, and metamask connects properly and everything seems to work as it should.

image

Any advice is appreciated! Thanks in advance.

Contract is not compiling / migrating

I'm following all the steps in the tutorial, but when I'm compiling and migrating the contract nothing happens - no errors, no status messages.

Last year I did this tutorial and all was fine. Could you please recheck all files.
Maybe it is anyhow connected with the latest updates and solidity 0.5.0.

Meta Mask change on 2nd November - Petshop tutorial web page no longer interacts with metamask!!!!

Metamask have implemented a change which no longer exposes account by default - which mean whilst the tutorial still works - the interaction with metamask no longer occurs -

I began playing with this early this year and was good introduction on how the various pieces hang together. I am using it again as part of a demo for college but need some help
Details of the reason they have stopped metamask interacting by default are here:

https://medium.com/metamask/https-medium-com-metamask-breaking-change-injecting-web3-7722797916a8

It mention that the following code should be added but I am not sure where - should it be in the app.js file?

The following code shows a new way to start up a dapp that can be used today in both legacy and modern dapp browsers:

window.addEventListener('load', async () => {
    // Modern dapp browsers...
    if (window.ethereum) {
        window.web3 = new Web3(ethereum);
        try {
            // Request account access if needed
            await ethereum.enable();
            // Acccounts now exposed
            web3.eth.sendTransaction({/* ... */});
        } catch (error) {
            // User denied account access...
        }
    }
    // Legacy dapp browsers...
    else if (window.web3) {
        window.web3 = new Web3(web3.currentProvider);
        // Acccounts always exposed
        web3.eth.sendTransaction({/* ... */});
    }
    // Non-dapp browsers...
    else {
        console.log('Non-Ethereum browser detected. You should consider trying MetaMask!');
    }
});

Add 'payable' functionality

Add to the tutorial how to create payable functions, so that a non-owner account can 'pay' for the dog adoption to the contract owner. Have the function and MetaMask use another ganache account to pay the contract in ethereum, then have the payable function transfer the ETH to the owner.

Currently having a ton of trouble making that^ work in the contract and it's pretty mandatory 101 knowledge for contract programming. It would be super useful if somebody who knew what they were doing could implement this in the tutorial

No response clicking "adopt" button

I am following the tutorial here: http://truffleframework.com/tutorials/pet-shop

At first, every step is successful, but when I finally test the pet shop in chrome, there is no response when I click the "adopt" button.

Truffle v4.0.3 (core: 4.0.3)
Solidity v0.4.18 (solc-js)

Chrome Version 62.0.3202.94 (Official Build) (64-bit)
MetaMask 3.13.2
Ganache 1.0.1
mac os 10.12.6

Click the "adopt" botton can't connect the transaction of wallet

Reason:

Today, I do a test about how to create dapp named pet-shop-box follow the offcial tutorial . I am following the tutorial is here:http://truffleframework.com/tutorials/pet-shop.The issue is occuring after I operate until the commend npm run dev,html is occur,but when I click the "adopt" button ,the terminal and web happen nothing,and when I run npm run dev,the terminal is show the 304.

System:

OS: ubuntu-14.04
Truffle v4.0.3 (core: 4.0.3)
Solidity v0.4.18 (solc-js)

Experiment

The First step:
the code of truffle.js as fellow:
module.exports = { // See <http://truffleframework.com/docs/advanced/configuration> // for more about customizing your Truffle configuration! networks: { development: { host: "localhost:", port: 8545, network_id: "*" // Match any network id } } };
the commend to launch ganache-cli as fellow:testrpc
the current RPC of MetaMask as fellow:http://localhost:8545

The Second step:
the code of truffle.js as fellow:
module.exports = { // See <http://truffleframework.com/docs/advanced/configuration> // for more about customizing your Truffle configuration! networks: { development: { host: "localhost:", port: 9545, network_id: "*" // Match any network id } } };
the commend to launch ganache-cli as fellow:truffle develop
the current RPC of MetaMask as fellow:http://localhost:9545

I have try the another port such 7545 and the host linke'172.0.0.1:port',but the issue still take place.And the develop tool of chorme is normal and no issue is remindered. But I type to console.log() in the app.js and observe the initcontract() is not work .So I don't know where the I should modify for this project?
The picture of terminal is here:
1
The picture of web is here:
3

Error: Contract has not been deployed to detected network (network/artifact mismatch)

Hi I am trying to follow pet-shop tutorial but I got error Contract has not been deployed to detected network (network/artifact mismatch)
_

OS: MacOS 10.13.1
Truffle v4.0.3 - a development framework for Ethereum
yarn --version 1.3.2

--
I also try to config in truffle.js but no luck

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 7545,
      network_id: "*" // Match any network id
    }
  }
};

Issue regarding npm run dev

When i m trying to run the dapp,an error is being thrown.
I'm new to this solidity stuff,and trying to learn through this pet-shop-box.
Can anyone help me?
Here is the error-:

Browsersync] Serving files from: ./src
[Browsersync] Serving files from: ./build/contracts
[Browsersync] Watching files...
events.js:182
throw er; // Unhandled 'error' event
^

Error: watch /home/hrishabh/crypto-pet/migrations/1_initial_migration.js ENOSPC
at _errnoException (util.js:1026:11)
at FSWatcher.start (fs.js:1383:19)
at Object.fs.watch (fs.js:1409:11)
at createFsWatchInstance (/home/hrishabh/crypto-pet/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/hrishabh/crypto-pet/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/hrishabh/crypto-pet/node_modules/chokidar/lib/nodefs-handler.js:232:14)
at FSWatcher.NodeFsHandler._handleFile (/home/hrishabh/crypto-pet/node_modules/chokidar/lib/nodefs-handler.js:259:21)
at FSWatcher. (/home/hrishabh/crypto-pet/node_modules/chokidar/lib/nodefs-handler.js:480:21)
at FSReqWrap.oncomplete (fs.js:154:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: lite-server
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/hrishabh/.npm/_logs/2018-12-27T17_56_55_600Z-debug.log
hrishabh@hrishabh-HP-Pavilion-15-Notebook-PC:~/crypto-pet$ npm run serve
npm ERR! missing script: serve

npm ERR! A complete log of this run can be found in:
npm ERR! /home/hrishabh/.npm/_logs/2018-12-27T17_57_30_778Z-debug.log

Errors unboxing

I'm getting the following errors from truffle unbox pet-shop:

Downloading...
Unpacking...
Setting up...
Error: Command failed: npm install
npm WARN deprecated [email protected]: express 2.x series is deprecated
npm WARN deprecated [email protected]: connect 1.x series is deprecated
npm WARN ETXTBSY: text file is busy, rmdir '/host/pet-shop-tutorial/node_modules/fsevents/build/Release/.deps/Users/eshanker/Code/fsevents'
npm ERR! path ../dev-ip/lib/dev-ip.js
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink
npm ERR! EPROTO: protocol error, symlink '../dev-ip/lib/dev-ip.js' -> '/host/pet-shop-tutorial/node_modules/.bin/dev-ip'


npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2017-12-05T13_29_49_590Z-debug.log

    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

I'm running in an ubuntu xenial virtual machine (vagrant file here).

unexpected error gets logged while unboxing

$ truffle unbox pet-shop
Starting unbox...
=================

✔ Preparing to download box
✔ Downloading
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v72-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, unknown) (falling back to source compile with node-gyp) 
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/x/.nvm/versions/node/v12.18.3/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/x/.nvm/versions/node/v12.18.3/bin/node" "/Users/x/.nvm/versions/node/v12.18.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/x/project/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/x/project/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64" "--napi_version=6" "--node_abi_napi=napi"
gyp ERR! cwd /Users/x/project/node_modules/fsevents
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/x/.nvm/versions/node/v12.18.3/bin/node /Users/x/.nvm/versions/node/v12.18.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/x/project/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/x/project/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=6 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/x/project/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Darwin 19.6.0
node-pre-gyp ERR! command "/Users/x/.nvm/versions/node/v12.18.3/bin/node" "/Users/x/project/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/x/project/node_modules/fsevents
node-pre-gyp ERR! node -v v12.18.3
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok 
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

✔ Cleaning up temporary files
✔ Setting up box

Unbox successful, sweet!

Commands:

  Compile:        truffle compile
  Migrate:        truffle migrate
  Test contracts: truffle test
  Run dev server: npm run dev

Upgrade web3

A user reported that the current web3 version (0.19.x) is incompatible with the latest build of MetaMask. Upgrading to 0.20.6 fixed the problem.

(Metamask was showing 2 tx confirmation windows instead of 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.