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

Missing core-js dependency #491

Closed
medmunds opened this issue Jun 10, 2019 · 3 comments
Closed

Missing core-js dependency #491

medmunds opened this issue Jun 10, 2019 · 3 comments

Comments

@medmunds
Copy link

When particle-cli 1.41.1 is installed through yarn (or presumably npm), every particle command results in Error: Cannot find module 'core-js/modules/es.array.index-of'.

The problem appears to be that core-js is listed in devDependencies, so doesn't normally get installed; it should probably be moved to regular dependencies.

To reproduce:

$ node -v
v10.16.0
$ yarn -v
1.16.0
$ yarn add particle-cli
...
success Saved 368 new dependencies.
info Direct dependencies
└─ particle-cli@1.41.1
...
$ particle --version
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'core-js/modules/es.array.index-of'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/Users/medmunds/dev/waterbot/firmware/node_modules/particle-cli/dist/app/cli.js:3:1)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

(And any other particle command results in the same error.)

To workaround, install the missing dependency:

$ yarn add core-js
...
success Saved 1 new dependency.
info Direct dependencies
└─ core-js@3.1.3
...
$ particle --version
1.41.1

(This was not a problem in particle-cli 1.23.1, so appears to be an injection since then.)

@busticated
Copy link
Contributor

thanks for the report 👍

fixed here: #492

@busticated
Copy link
Contributor

and released in v1.41.2 (changelog)

reopen if the issue persists 👍

@medmunds
Copy link
Author

@busticated thanks, confirmed fixed in v1.41.2.

[Incidentally, if installing with yarn on newer Node versions, yarn's --ignore-engines flag is now required due to a recent change in wiring-preprocessor. Unlike npm, yarn is by default strict about package.json engines requirements, and wiring-preprocessor now says it wants only Node v8. Let me know if you'd like a separate report there.]

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

2 participants