{"id":18816023,"url":"https://github.com/0-vortex/replit-node16-npm8-global-starter","last_synced_at":"2026-01-14T06:30:17.389Z","repository":{"id":151933474,"uuid":"441436120","full_name":"0-vortex/replit-node16-npm8-global-starter","owner":"0-vortex","description":"bare install of node@16 and npm@8 with a global config set in home folder able to do global installs","archived":false,"fork":false,"pushed_at":"2021-12-30T07:29:26.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-30T01:34:42.543Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0-vortex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-24T10:26:23.000Z","updated_at":"2022-02-13T00:24:37.000Z","dependencies_parsed_at":"2023-05-18T03:00:23.972Z","dependency_job_id":null,"html_url":"https://github.com/0-vortex/replit-node16-npm8-global-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0-vortex%2Freplit-node16-npm8-global-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0-vortex%2Freplit-node16-npm8-global-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0-vortex%2Freplit-node16-npm8-global-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0-vortex%2Freplit-node16-npm8-global-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0-vortex","download_url":"https://codeload.github.com/0-vortex/replit-node16-npm8-global-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239753703,"owners_count":19691160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T23:52:01.018Z","updated_at":"2026-01-14T06:30:17.349Z","avatar_url":"https://github.com/0-vortex.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Replit Nix Node@16 Npm@8 tutorial\n\n[![Open in Replit](https://repl.it/badge/github/0-vortex/replit-node16-npm8-global-starter)](https://repl.it/github/0-vortex/replit-node16-npm8-global-starter)\n\n\u003e Warning: Nix support on Replit is still under heavy development and is subject to change.\n\nYou've just created a new Nix repl. There's not much here yet but with a little work you can use it as the starting point for *ANYTHING*.\n\nTo get started there are 2 config files that you can use to customize the environment. To show them click the 3 dots menu button in the file tree and then click \"Show config files\".\n\n### `shell.nix` - Configures the nix shell environment\n\nThis file should look something like the example below. The `deps` array is replaced by shell generation.\n\nWhat we are doing here is getting a sandbox reload mechanism, `node@16` and a separate binary install of `npm@8` which we then configure to sensible userspace defaults:\n\n```nix\n{ pkgs ? import \u003cnixpkgs\u003e {} }:\n\nlet\n  NPM_PREFIX = \"$HOME/.npm-global\";\n\nin\n  pkgs.mkShell {\n    inherit NPM_PREFIX;\n\n    packages = with pkgs; [\n      busybox\n      nodejs-16_x\n    ];\n\n    N_PRESERVE_NPM = 1;\n    N_PREFIX = \"/home/runner/.n\";\n\n    shellHook = ''\n      npm config set prefix \"${NPM_PREFIX}\"\n      npm i -g npm@latest n typescript-language-server\n      export PATH=\"$N_PREFIX/bin:${NPM_PREFIX}/bin:$PATH\"\n    '';\n  }\n```\n\n### `.replit` - Configures the run command\n\nThe run command in this file should look something like this. You can use any binary made available by your `shell.nix` file in this run command.\n\nWe assume it will be npm scripts that you want to run.\n\n```toml\nlanguage = \"nix\"\nrun = \"node -v \u0026\u0026 npm -v\"\n\n[packager]\nlanguage = \"nodejs-npm\"\n\n  [packager.features]\n  packageSearch = true\n  guessImports = false\n\n[unitTest]\nlanguage = \"nodejs\"\n\n[languages.javascript]\npattern = \"**/*.js\"\nsyntax = \"javascript\"\n\n  [languages.javascript.languageServer]\n  start = [ \"typescript-language-server\", \"--stdio\" ]\n\n[nix]\nchannel = \"unstable\"\n\n[env]\nXDG_CONFIG_HOME = \"/home/runner/.config\"\n```\n\nYou can manually restart the environment by running:\n\n```shell\nbusybox reboot\n```\n\nOnce both those files are configured and you add files for your language, you can run you repl like normal, with the run button.\n\nBoth the Console and Shell will pick up changes made to your `replit.nix` file. However, once you open the Shell tab, the environment will not update until you run `exit`. This will close out the existing `shell` process and start a new one that includes any changes that you made to your `replit.nix` file.\n\n### Credits and inspiration\n\n- [@replit/Nix-beta](https://replit.com/@replit/Nix-beta?v=1)\n- [@RoBlockHead/NodeJS-16](https://replit.com/@RoBlockHead/NodeJS-16?v=1)\n- [@amasad/Live-Coding-in-Nodejs](https://replit.com/@amasad/Live-Coding-in-Nodejs?v=1)\n- [@ConnorBrewster/BetterNode-3](https://replit.com/@ConnorBrewster/BetterNode-3?v=1)\n- [replit blog nix dynamic version](https://blog.replit.com/nix_dynamic_version)\n\n## Learn More About Nix\n\nIf you'd like to learn more about Nix, here are some great resources:\n\n* [Getting started with Nix](https://docs.replit.com/programming-ide/getting-started-nix) - How to use Nix on Replit\n* [Nix Pills](https://nixos.org/guides/nix-pills/) - Guided introduction to Nix\n* [Nixology](https://www.youtube.com/playlist?list=PLRGI9KQ3_HP_OFRG6R-p4iFgMSK1t5BHs) - A series of videos introducing Nix in a practical way\n* [Nix Package Manager Guide](https://nixos.org/manual/nix/stable/) - A comprehensive guide of the Nix Package Manager\n* [A tour of Nix](https://nixcloud.io/tour) - Learn the nix language itself\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0-vortex%2Freplit-node16-npm8-global-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0-vortex%2Freplit-node16-npm8-global-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0-vortex%2Freplit-node16-npm8-global-starter/lists"}