13
238
Fork
You've already forked app
18

create wrapper around kitten-npm so kitten-node is always used #303

Open
wunter8 wants to merge 1 commit from wunter8/kitten-app:kitten-npm-wrapper into main
pull from: wunter8/kitten-app:kitten-npm-wrapper
merge into: kitten:main
kitten:main
kitten:full-typescript
kitten:stateful-components-api-breaking-change
kitten:ip-address-support
kitten:improved-markdown-pages
kitten:markdown-consistency
kitten:proper-markdown-implementation-take-2
kitten:proper-markdown-implementation
kitten:fix-markdown-links
kitten:improved-component-model
kitten:middleware-refactor
kitten:implicit-event-handlers
kitten:event-scopes
kitten:regression-tests
kitten:access-stats
kitten:stats
kitten:connected-components
kitten:streaming-html-kitten-chat-examples
kitten:data-encapsulation
kitten:domain-migrations
kitten:better-slash-forwarding-in-urls
kitten:manual-app-updates
kitten:logs
kitten:kitten-scoped-database
kitten:only-inform-small-web-host-of-status-updates-if-being-deployed-by-it
kitten:only-ping-domain-on-first-deploy
kitten:markdown-pages
kitten:node-22
kitten:id-command
kitten:settings-refactor
kitten:show-uploads-in-settings
kitten:backup-and-restore
kitten:database-view-in-settings
kitten:prewarmed-servers
kitten:htmx-2
kitten:html-and-css-fragments
kitten:without-source-maps
kitten:only-use-kitten-process-manager-for-development-servers
kitten:parameter-objects
kitten:page-socket-routes
kitten:versioning-and-package-json-changes
kitten:evergreen-web
kitten:auto-updates
kitten:build-web-into-dist
kitten:two-databases-are-better-than-one
kitten:kitten-namespace
kitten:npm-ci
kitten:use-my-htmx-fork
kitten:errors-not-exits-wip
kitten:standardisation
kitten:strong-typing-and-tests
kitten:kitten-tag
kitten:page-tag
kitten:db-table-delete
kitten:npm-install-and-validation-issues-on-html
kitten:busboy-express
kitten:readline-under-cluster
kitten:development-libraries
kitten:slots-and-classes
kitten:named-slots
kitten:credits
kitten:dot-js
kitten:markdown-fix
kitten:safer-fields
kitten:validation
kitten:wrapping-the-renderer
kitten:xhtm
kitten:end-to-end-encrypted-chat-example
kitten:chokidar-to-watcher-migration
kitten:alpinejs
kitten:uri-cleanup
kitten:web-settings
kitten:cryptography
kitten:settings-app
kitten:development-mode
kitten:post
First-time contributor
Copy link

I had node installed on my computer before installing Kitten. When I would run kitten-npm, it would use the previously-installed node instead of kitten-node.

This changes kitten-npm from a simple symlink into a simple bash script that makes sure to prepend the KITTEN_RUNTIME_BINARIES_PATH to the PATH env variable before calling kitten-npm so that the version of node installed by kitten is always used when kitten-npm is called.

This is basically replicating the functionality that already exists here:

Lines 267 to 281 in 8c4e473
export function npm (command, modulePath) {
const env = Object.assign(process.env, {NODE_OPTIONS: ''})
env.PATH = `${paths.KITTEN_RUNTIME_BIN_DIRECTORY}:${env.PATH}`
try {
childProcess.execSync(`${kittenNpm}${command}`, {
encoding: 'utf-8',
env,
cwd: modulePath
})
return true
} catch (error) {
console.error(`npm ${command} failed on path ${modulePath}`, error)
return false
}
}
I had `node` installed on my computer before installing Kitten. When I would run `kitten-npm`, it would use the previously-installed `node` instead of `kitten-node`. This changes `kitten-npm` from a simple symlink into a simple bash script that makes sure to prepend the KITTEN_RUNTIME_BINARIES_PATH to the PATH env variable before calling `kitten-npm` so that the version of `node` installed by kitten is always used when `kitten-npm` is called. This is basically replicating the functionality that already exists here: https://codeberg.org/kitten/app/src/commit/8c4e473c4cf63c8b732773bc246287eae89ec998/src/Utils.js#L267-L281
wunter8 force-pushed kitten-npm-wrapper from 124645cab3 to c8f7e5a274 2025年12月24日 22:00:58 +01:00 Compare
wunter8 force-pushed kitten-npm-wrapper from c8f7e5a274 to 91939616b8 2026年01月19日 22:33:11 +01:00 Compare
wunter8 force-pushed kitten-npm-wrapper from 91939616b8 to 9180625a95 2026年02月04日 16:37:14 +01:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u kitten-npm-wrapper:wunter8-kitten-npm-wrapper
git switch wunter8-kitten-npm-wrapper

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff wunter8-kitten-npm-wrapper
git switch wunter8-kitten-npm-wrapper
git rebase main
git switch main
git merge --ff-only wunter8-kitten-npm-wrapper
git switch wunter8-kitten-npm-wrapper
git rebase main
git switch main
git merge --no-ff wunter8-kitten-npm-wrapper
git switch main
git merge --squash wunter8-kitten-npm-wrapper
git switch main
git merge --ff-only wunter8-kitten-npm-wrapper
git switch main
git merge wunter8-kitten-npm-wrapper
git push origin main
Sign in to join this conversation.
No reviewers
Labels
Clear labels
documentation
Anything related to documentation
error messages
Issues related to Kitten’s error message handling
examples
Related to apps in the examples folder
housekeeping
Improves code quality by refactoring redundancy, removing old code, etc.
low priority
A non-essential nice-to-have
needs design
Not a simple fix but something that requires architectural work
parser
Issues regard Kitten HTML parser (inc. Markdown)
tests
Related to tests (unit, end-to-end, etc.) in some way
usability
Anything that affects usability
accessibility
Accessibility-related issues
API
Issues related to Kitten’s public interface (for authors)
bug
Something is not working
CLI
Command-line interface related issues (Kitten commands)
contribution welcome
Contributions are very welcome, get started here
crash
A bug that crashes the server
deployment
Related to the deployment of Kitten apps/sites
duplicate
This issue or pull request already exists
enhancement
New feature
feature branch
Relates to a feature being developed in a separate branch (not main)
good first issue
Interested in contributing? Get started here.
help wanted
Need some help
installer
Issues related to the installation script
invalid
Something is wrong
is this still an issue?
Issues that need to be reproduced to confirm they haven’t already been fixed or made redundant
linux
Linux-specific issue
localisation
Localisation and internationalisation-related issues
macOS
macOS-specific issue
question
More information is needed
security
Security related issues
suggestion
upstream
Related to an upstream repository, already reported there
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kitten/app!303
Reference in a new issue
kitten/app
No description provided.
Delete branch "wunter8/kitten-app:kitten-npm-wrapper"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?