question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable global npm installation

See original GitHub issue

The location of testrpc-sc is hardcoded as:

        const npm = './node_modules/.bin/testrpc-sc';
        const yarn = './node_modules/ethereumjs-testrpc-sc/build/cli.node.js';

Can the output of npm bin be used instead?

$ pwd
/home/ravi/repo/erc20/zeppelin-hitchhiker-guide
$ npm bin
/home/ravi/repo/erc20/node_modules/.bin

Here is the error I get:

$ $(npm bin)/solidity-coverage
Generating coverage environment
Instrumenting  ./coverageEnv/contracts/ConvertLib.sol
Instrumenting  ./coverageEnv/contracts/MetaCoin.sol
Skipping instrumentation of  ./coverageEnv/contracts/Migrations.sol
Instrumenting  ./coverageEnv/contracts/ProofOfExistence1.sol
testRpc stderr:
/bin/sh: ./node_modules/.bin/testrpc-sc: No such file or directory

Cleaning up...
testRpc errored after launching as a childprocess.
Exiting without generating coverage...
$ 

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
HaleTomcommented, Oct 6, 2017

FYI, yarn does have a selective version resolution feature.

The npm doco says:

If you want to use it as a command line tool, something like the grunt CLI, then you want to install it globally. On the other hand, if you want to depend on the package from your own module using something like Node’s require, then you want to install locally.

Because I want to use solidity-coverage at the command line, I installed it globally.

So, following the docs, ./node_modules/.bin/testrpc-sc won’t work.

Could we assume that the user has setup their $PATH correctly and execute it without a leading path?

0reactions
cgeweckecommented, Oct 7, 2017

Renaming this issue and filing under enhancement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Downloading and installing packages globally - npm Docs
To download and install packages globally, on the command line, run the following command: npm install -g <package_name>. If you get an EACCES...
Read more >
How to npm install global not as root? - node.js - Stack Overflow
8 Answers 8 · 1. Configure npm · 2. Make sure ~/.local/bin exists and is in your PATH · 3. Install packages globally....
Read more >
NPM - Node Package Manager - TutorialsTeacher
Install Package Globally. NPM can also install packages globally so that all the node.js application on that computer can import and use the...
Read more >
guides/npm-global-without-sudo.md at main - GitHub
Install npm packages globally without sudo on macOS and Linux · 1. Create a directory for global packages · 2. Tell npm where...
Read more >
A Note on Permissions | Introduction
You may receive an EACCES error when you try to install a package globally. This indicates that you do not have permission to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found