@pas256 ➜ /workspaces/tailwindcss (23a6d3f) $ wget https://github.com/tailwindlabs/tailwindcss/releases/download/v3.0.24/tailwindcss-linux-x64
--2022-04-30 18:41:40-- https://github.com/tailwindlabs/tailwindcss/releases/download/v3.0.24/tailwindcss-linux-x64
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/106017343/e15d5682-24c3-46af-859a-790f27ce81a5?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220430%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220430T184140Z&X-Amz-Expires=300&X-Amz-Signature=2e1d9fdc39e7e109eb052b097d1fc4b753894fcec9dd36ae2378c4b18833244b&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=106017343&response-content-disposition=attachment%3B%20filename%3Dtailwindcss-linux-x64&response-content-type=application%2Foctet-stream [following]
--2022-04-30 18:41:40-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/106017343/e15d5682-24c3-46af-859a-790f27ce81a5?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20220430%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220430T184140Z&X-Amz-Expires=300&X-Amz-Signature=2e1d9fdc39e7e109eb052b097d1fc4b753894fcec9dd36ae2378c4b18833244b&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=106017343&response-content-disposition=attachment%3B%20filename%3Dtailwindcss-linux-x64&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 40181800 (38M) [application/octet-stream]
Saving to: ‘tailwindcss-linux-x64’
tailw 0% 0 --.-KB/s tailwi 5% 2.15M 9.53MB/s tailwin 10% 4.01M 7.94MB/s tailwind 20% 8.01M 10.4MB/s tailwindc 28% 11.04M 11.1MB/s tailwindcs 31% 12.01M 9.56MB/s tailwindcss 41% 16.01M 10.5MB/s ailwindcss- 52% 19.98M 11.4MB/s ilwindcss-l 52% 20.01M 9.98MB/s lwindcss-li 62% 24.01M 10.6MB/s windcss-lin 73% 28.01M 11.1MB/s indcss-linu 83% 32.01M 11.6MB/s ndcss-linux 93% 36.01M 12.0MB/s etailwindcss 100% 38.32M 12.6MB/s in 3.0s
2022-04-30 18:41:45 (12.6 MB/s) - ‘tailwindcss-linux-x64’ saved [40181800/40181800]
@pas256 ➜ /workspaces/tailwindcss (23a6d3ff ✗) $ chmod 755 ./tailwindcss-linux-x64
@pas256 ➜ /workspaces/tailwindcss (23a6d3ff ✗) $ ./tailwindcss-linux-x64
node:internal/modules/package_json_reader:4
const internalModuleReadJSON = function (f) { return require('fs').internalModuleReadJSON(f); };
TypeError: require(...).internalModuleReadJSON is not a function
at internalModuleReadJSON (node:internal/modules/package_json_reader:4:68)
at Object.read (node:internal/modules/package_json_reader:21:42)
at readPackage (node:internal/modules/cjs/loader:296:36)
at readPackageScope (node:internal/modules/cjs/loader:329:19)
at trySelf (node:internal/modules/cjs/loader:444:40)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:910:24)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at Module._preloadModules (node:internal/modules/cjs/loader:1276:12)
at loadPreloadModules (node:internal/bootstrap/pre_execution:487:5)
@pas256 ➜ /workspaces/tailwindcss (23a6d3ff ✗) $
Reproduction steps
Go to https://github.com/tailwindlabs/tailwindcss
Click on "Code" => "Codespaces" and create a new one
Once booted, in the terminal window, run:
wget https://github.com/tailwindlabs/tailwindcss/releases/download/v3.0.24/tailwindcss-linux-x64
chmod 755 ./tailwindcss-linux-x64
./tailwindcss-linux-x64
Observe the TypeError: require(...).internalModuleReadJSON is not a function
error.
Ah, you are quite right! The problem is that inside the GitHub Codespace, they do this
echo $NODE_OPTIONS
--require /home/codespace/.vscode-remote/data/User/workspaceStorage/53617db6/ms-vscode.js-debug/bootloader.js
so the solution is to run
unset NODE_OPTIONS
... and then the CLI works beautifully.
Thanks for your help @adamwathan. I'll close this.