Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install OpenZeppelin #532

Closed
pablogalve opened this issue Nov 4, 2017 · 7 comments
Closed

Can't install OpenZeppelin #532

pablogalve opened this issue Nov 4, 2017 · 7 comments

Comments

@pablogalve
Copy link

I have installed Truffle, but I cannot install the OpenZeppelin library.
I run "npm install zeppelin-solidity" in the console but I get this:
captura46

After that I created the folder C:Users/Pablo/package.json but now I get this
captura45

What can I do?

@gulshanvas
Copy link

gulshanvas commented Nov 4, 2017

Hi,
Replace the contents of package.json file with the following :-

{
"name": "zeppelin",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"zeppelin-solidity": "^1.3.0"
}
}

After replacing,run :- npm install zeppelin-solidity
This will pull the zeppelin contracts and other folders under node_modules folder in your current directory.

@prahaladbelavadi
Copy link

Hey @eduinvestor
I'd suggest trying the following steps one more time:

  • Change Working directory
cd ~/Desktop
mkdir openZeppelinSetup && cd openZeppelinSetup
  • Initialize npm
npm init 
  • Install both truffle and openzeppelin solidity
npm install --save zeppelin-solidity truffle

Here's some material to follow up post installation.

Cheers!

@KenoLeon
Copy link

KenoLeon commented Nov 5, 2017

Still no luck with both suggestion, could it be related with Truffles new version, I am on:

Truffle v4.0.1 (core: 4.0.1)
Solidity v0.4.18 (solc-js)

And my errors:

npm WARN kenoleon@1.0.0 No description
npm WARN kenoleon@1.0.0 No repository field.

Do I need to init Nom if so what are the correct fields ? Thanks

@KenoLeon
Copy link

KenoLeon commented Nov 5, 2017

So after playing around I found the package in my local node_modules which I think is the expected behavior,( still have to include them in a test) although the docs state "After that, you’ll get all the library’s contracts in the contracts/zeppelin folder" which I think is a bit misleading since it could refer to the initialized truffle dir.

@KenoLeon
Copy link

KenoLeon commented Nov 5, 2017

New errors not finding contracts now... about to chew my arm in desperation !

Just kidding, in the end this is what worked, still not sure this is the intended behavior, and the docs seems to need a bit of updating or maybe even rewriting cause they were not very clear (to me at least) , anyways:

Following this issue worked or me: #409

So to install:

mkdir poneteLasPilasProject  && cd poneteLasPilasProject
npm init
truffle init
npm install zeppelin-solidity
truffle compile

This creates a node_modules inside poneteLasPilasProject with contracts, to access them within Truffle, ( the path in the docs is I believe incorrect):

pragma solidity ^0.4.0;

import "../node_modules/zeppelin-solidity/contracts/ownership/Ownable.sol";

contract masPila {

}

Cheers.

@shrugs
Copy link
Contributor

shrugs commented Nov 6, 2017

@KenoLeon you can access them with just import 'zeppelin-solidity/contracts/.....sol'.

In general, it sounds like your node environment is a little wonky. It might be worth looking into nvm or some other node environment manager to isolate project environments (and you generally want to avoid -g unless it's a globally-useful tool like yarn or similar.

The warnings about "no repository field" and "no description" aren't important; those are commenting on the fact that your package.json doesn't specify that information. It's not truffle or open zeppelin related.


@eduinvestor did the following comments solve your issue?

@maraoz
Copy link
Contributor

maraoz commented Nov 11, 2017

poneteLasPilasProject

❤️

Closing as this seems to be solved.
@eduinvestor if you think the docs are outdated please send a PR to improve them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants