Hi,
I ran into some problem when installing on maOS Catalina 10.15.1.
Env:
node --version: v10.17.0
npm --version: 6.12.1
I must use sudo, else it fails.
I can only npm install @openzeppelin/cli@2.6 locally into a project.
I tried sudo installing globally - this removed my previous global npm @openzeppelin/cli package, but did not replace it with the 2.6 version. Instead it, I get the following error:
Sorry to hear that you are running into permission issues when installing.
Using sudo with npm is highly discouraged, so I recommend resolving the permission issues, either with a node version manager or change npm's default directory:
Hi @abcoathup - I have not used nvm yet, but it always reappears the more I look around in the npm/node ecosystem. So far, I have used homebrew on macOS to manage my packages. I will give nvm a try asap. For now I am happy continuing my work with the local version and running npx.
Hi @abcoathup.
I finally installed nvm and use it now. And success, I was able to install the @openzeppelin/cli into my global npm store for my nvm node --version 12.13.0.
Note: On OS X, if you get nvm: command not found after running the install script, one of the following might be the reason:
Your system may not have a .bash_profile file where the command is set up. Create one with touch ~/.bash_profile and run the install script again
You might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.
If the above doesn't fix the problem, you may try the following:
Open your .bash_profile (or ~/.zshrc , ~/.profile , or ~/.bashrc ) and add the following line of code: source ~/<your_profile_file> . E.g. source ~/.bashrc or source ~/.zshrc .
If the above don't work, try adding the snippet from the install section that finds the correct nvm directory and loads nvm, to your profile ( ~/.bash_profile , ~/.zshrc , ~/.profile , or ~/.bashrc ).
For more information about this issue and possible workarounds, please refer here
Sorry that you are still having trouble with the environment.
Have you also been through this issue as there appear to be a couple of things you could try? https://github.com/nvm-sh/nvm/issues/576
For now I suggest that you could install OpenZeppelin SDK locally (rather than globally) and use via npx, so that you can start using it.
I tried this npx @openzeppelin/cli@2.6 and got this error
Error
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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/pk/.npm/_npx/9590/lib/node_modules/@openzeppelin/cli/node_modules/solc-wrapper/node_modules/keccak
gyp ERR! node -v v10.16.2
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keccak@1.4.0 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keccak@1.4.0 rebuild 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! /Users/pk/.npm/_logs/2019-11-21T04_55_38_098Z-debug.log
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
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 (/usr/local/lib/node_modules/npx/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npx/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/pk/.npm/_npx/9590/lib/node_modules/@openzeppelin/cli/node_modules/sha3
gyp ERR! node -v v10.16.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sha3@1.2.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sha3@1.2.3 install 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! /Users/pk/.npm/_logs/2019-11-21T04_55_46_186Z-debug.log
Install for @openzeppelin/cli@2.6 failed with code 1
I am getting build error now for this command npx npm install @openzeppelin/cli
Error
npx npm install @openzeppelin/cli at 16:42:20
npm WARN deprecated truffle-config@1.1.16: WARNING: This package has been renamed to @truffle/config.
npm WARN deprecated truffle-provider@0.1.16: WARNING: This package has been renamed to @truffle/provider.
npm WARN deprecated truffle-interface-adapter@0.2.5: WARNING: This package has been renamed to @truffle/interface-adapter.
> sha3@1.2.3 install /Users/pk/Documents/code/abstract/abstract-st/node_modules/sha3
> node-gyp rebuild
CXX(target) Release/obj.target/sha3/src/addon.o
In file included from ../src/addon.cpp:9:
In file included from ../src/KeccakNISTInterface.h:17:
../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
#define ALIGN __attribute__ ((aligned(32)))
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/i386/param.h:83:9: note:
previous definition is here
#define ALIGN(p) __DARWIN_ALIGN(p)
^
../src/addon.cpp:83:11: error: no matching member function for call to 'Set'
target->Set(className, f);
~~~~~~~~^~~
/Users/pk/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3424:37: note: candidate function not viable: requires 3 arguments, but
2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/pk/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3427:37: note: candidate function not viable: requires 3 arguments, but
2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
1 warning and 1 error generated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/pk/.nvm/versions/node/v13.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/Users/pk/.nvm/versions/node/v13.1.0/bin/node" "/Users/pk/.nvm/versions/node/v13.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/pk/Documents/code/abstract/abstract-st/node_modules/sha3
gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sha3@1.2.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sha3@1.2.3 install 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! /Users/pk/.npm/_logs/2019-11-21T05_42_44_953Z-debug.log