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

Creating two apps with manual npm install step throws #215

Open
jelhan opened this issue Oct 2, 2019 · 0 comments
Open

Creating two apps with manual npm install step throws #215

jelhan opened this issue Oct 2, 2019 · 0 comments

Comments

@jelhan
Copy link
Contributor

jelhan commented Oct 2, 2019

Seeing an error thrown by npm itself if I create two apps with manual npm install steps in the same mocha instance:

const expect = require('chai').expect;
const AddonTestApp = require('ember-cli-addon-tests').AddonTestApp;

describe('creating two apps', function() {
  this.timeout(300000);

  it('creates first app', async function() {
    let app = new AddonTestApp();

    await app.create('default', {
      noFixtures: true,
      skipNpm: true,
    });
    await app.run('npm', 'install');
  });

  it('creates second app with different dependencies', async function() {
    let app = new AddonTestApp();

    await app.create('default', {
      noFixtures: true,
      skipNpm: true,
    });
    await app.run('npm', 'install');
  });
});
  creating two apps
    ✓ creates first app (47737ms)
    1) creates second app with different dependencies
npm WARN 
deprecated [email protected]: Please replace with usage of fs.existsSync

npm
 ERR! cb() never called!



npm ERR! This is an error with npm itself. Please report this error at:
npm
 ERR!     <https://npm.community>



  1 passing (3m)
  1 failing

  1) creating two apps
       creates second app with different dependencies:
     Error: the object {
  "code": 1
  "errors": [
    "npm WARN "
    "deprecated [email protected]: Please replace with usage of fs.existsSync\n"
    "npm"
    " ERR! cb() never called!\n"
    "\n"
    "npm ERR! This is an error with npm itself. Please report this error at:\nnpm"
    " ERR!     <https://npm.community>\n"
  ]
  "output": []
  "signal": [null]
} was thrown, throw an Error :)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)
$ ember -v
ember-cli: 3.13.1
node: 8.16.1
os: linux x64

$ npm -v
6.4.1

Please note that this only happening if app.run('npm', 'install') is called twice. It seems to work fine if installed as part of app.create('default', { noFixtures: true }) and not calling app.run('npm', 'install') manually.

A work-a-round is splitting it up into multiple files and running a mocha instance per file.

I've faced this in adopted-ember-addons/ember-cli-content-security-policy#113.

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

1 participant