Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.09k stars 1.2k forks source link

Cannot install @azure/service-bus #2779

Closed lenkan closed 5 years ago

lenkan commented 5 years ago

Describe the bug When installing @azure/service-bus, it fails with error due to failing preinstall script. See attached error message.

To Reproduce Steps to reproduce the behavior:

  1. Create empty directory
  2. Run npm install @azure/service-bus

Expected behavior Package is downloaded without error.

Screenshots

➜  tmp npm i @azure/service-bus

> @azure/amqp-common@1.0.0-preview.4 preinstall /home/lenkan/code/node_modules/@azure/amqp-common
> node ../../../common/scripts/rush-welcome.js

internal/modules/cjs/loader.js:584
    throw err;
    ^

Error: Cannot find module '/home/lenkan/code/common/scripts/rush-welcome.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm WARN enoent ENOENT: no such file or directory, open '/home/lenkan/code/package.json'
npm WARN code No description
npm WARN code No repository field.
npm WARN code No README data
npm WARN code No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @azure/amqp-common@1.0.0-preview.4 preinstall: `node ../../../common/scripts/rush-welcome.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @azure/amqp-common@1.0.0-preview.4 preinstall 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/lenkan/.npm/_logs/2019-05-09T13_24_22_387Z-debug.log
lenkan commented 5 years ago

https://github.com/Azure/azure-sdk-for-js/commit/98c4b34884a44d3f8f8b07c86feb783b1d64676f

This seems to be the issue (?)

nodulusteam commented 5 years ago

Same here, cannot install the module.


> @azure/amqp-common@1.0.0-preview.4 preinstall c:\Git_work\alien-vault\allegro-methodus\modules\@allegro\service-bus\node_modules\@azure\amqp-common
> node ../../../common/scripts/rush-welcome.js

internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'c:\Git_work\alien-vault\allegro-methodus\modules\@allegro\service-bus\common\scripts\rush-welcome.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:279:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:752:3)
MatteoDiPaolo commented 5 years ago

Same problem for me:

> @azure/amqp-common@1.0.0-preview.4 preinstall /Users/dipa/Desktop/infinitas/service-liber-api/node_modules/@azure/amqp-common
> node ../../../common/scripts/rush-welcome.js

module.js:549
    throw err;
    ^

Error: Cannot find module '/Users/dipa/Desktop/infinitas/service-liber-api/common/scripts/rush-welcome.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
psytraxx commented 5 years ago

We do have the same problem with the latest version although it fails with a different error message

error C:\Development\GraphQL\node_modules\@azure\service-bus\node_modules\@azure\amqp-common: Command failed.

We think its related to the recent @azure/amqp-common_1.0.0-preview.4 version bump which is a dependency of l @azure/service-bus

lenkan commented 5 years ago

I worked around the issue for now by doing

npm i --save @azure/amqp-common@1.0.0-preview.3

before running

npm i --save @azure/service-bus@1.0.0-preview.3
bsiegel commented 5 years ago

Apologies, this slipped through our review for the preview. We've got the fix merged and will be cutting a preview.5 release shortly.