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, npx, and yarn scripts are throwing an error — Cannot find module '../dist/lib' #185

Closed
wcalderipe opened this issue Oct 5, 2020 · 4 comments

Comments

@wcalderipe
Copy link

Hey folks 👋

I'm having an error with npm, npx and yarn following the same instructions described on the README.

OS: Ubuntu 20.04.1 LTS
OpenJDK: build 11.0.8+10-post-Ubuntu-0ubuntu120.04


Using npm and npx.

~/dev❯ npm -v
6.14.4
~/dev❯ npm init cljs-app my-app

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

Error: Cannot find module '../dist/lib'
    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:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/wcalderipe/.config/yarn/global/node_modules/create-cljs-app/bin/create-cljs-app.js:3:20)
                                                     /\ NOTICE THIS.

    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789: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)
~/dev❯ npx create-cljs-app my-app
Cannot find module '../dist/lib'

I also noticed that npm is trying to reach out yarn packages and I don't if this was intended.


Using yarn.

~/dev❯ yarn -v
1.22.5
~/dev❯ yarn create cljs-app my-app
yarn create v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "[email protected]" with binaries:
      - create-cljs-app
[########################################] 40/40internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '../dist/lib'
    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:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/wcalderipe/.config/yarn/global/node_modules/create-cljs-app/bin/create-cljs-app.js:3:20)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789: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)
error Command failed.
Exit code: 1
Command: /home/wcalderipe/.local/npm/bin/create-cljs-app
Arguments: my-app
Directory: /home/wcalderipe/dev
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Note: I don't know if this might impact the template scripts but I have changed the npm prefix to a different folder under my user so I don't have to install global packages using sudo.

@filipesilva
Copy link
Owner

Heya, there was definitely a bum release in 0.4.1, not sure why. Taking a look atm.

Regarding the yarn directory being used, I'm not sure that's under the control of this package at all. That seems to be a configuration item for npm.

@filipesilva
Copy link
Owner

Ok, should be fixed now in 0.4.3. Turns I was using a master ref for the github upload/download actions and their behaviour changed a bit. Pinned them now.

@wcalderipe
Copy link
Author

wcalderipe commented Oct 5, 2020

@filipesilva thanks for the fast replies and for keeping the issue updated.

I'll give it another whirl tomorrow. Looking forward to seeing how you folks are using devcards with shadow-cljs.

@filipesilva
Copy link
Owner

@wcalderipe still on an older version of React and Devcards, I'm afraid.

It's possible to update but a little hairy, see bhauman/devcards#168.

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