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

npm run clean:all fails on first pull of repo #3

Closed
benloh opened this issue Apr 1, 2019 · 2 comments
Closed

npm run clean:all fails on first pull of repo #3

benloh opened this issue Apr 1, 2019 · 2 comments

Comments

@benloh
Copy link
Contributor

benloh commented Apr 1, 2019

In GitLab by @daveseah on Apr 1, 2019, 16:45

to reproduce, run npm run clean:all twice.

error:

> [email protected] clean:all /Users/loh/dev/inq-seeds/boilerplate
> node meme clean --all

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

Error: Cannot find module 'shelljs'
    at Function.Module._resolveFilename 
    [...]

This is caused because meme.js requires shell.js when it's run as a script via package.json. However, since you just ran npm run clean:all, shelljs has been removed so meme.js throws the error.

PROPOSED FIX

Use require.resolve() to trap error, if trapping the regular require() doesn't work. Print a nice error message about needing to run npm ci first.

@benloh
Copy link
Contributor Author

benloh commented Apr 2, 2019

In GitLab by @daveseah on Apr 2, 2019, 03:26

Resolved in e335d79 by using regular try/catch block

@benloh
Copy link
Contributor Author

benloh commented Apr 2, 2019

In GitLab by @daveseah on Apr 2, 2019, 03:29

closed

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