NativeScript / NativeScript/plugins

[nativescript/localize] It cannot be installed in a site where there is no NS

Open
#172 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
206
Forks
123
Avg merge
2d 1h
Merged PRs (30d)
1

Description

I want to install it in a monorepo package outside the NS app but it gives an error when trying to install, I think it would be nice to be able to accept this

npm ERR! code 1
npm ERR! path C:\wordspaces\ns\monorepo\packages\core\core-native\node_modules\@nativescript\localize
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node postinstall
npm ERR! node:internal/modules/cjs/loader:936
npm ERR!   throw err;
npm ERR!   ^
npm ERR!
npm ERR! Error: Cannot find module '@nativescript/hook'
npm ERR! Require stack:
npm ERR! - C:\wordspaces\ns\monorepo\packages\core\core-native\node_modules\@nativescript\localize\postinstall.js
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:778:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1005:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:94:18)
npm ERR!     at Object.<anonymous> (C:\wordspaces\ns\monorepo\packages\core\core-native\node_modules\@nativescript\localize\postinstall.js:1:1)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     'C:\\wordspaces\\ns\\monorepo\\packages\\core\\core-native\\node_modules\\@nativescript\\localize\\postinstall.js'
npm ERR!   ]
npm ERR! }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the install from a monorepo package without a NativeScript app, then inspect postinstall.js and its use of @nativescript/hook. Confirm the expected behavior for this context and verify that npm installation no longer fails with MODULE_NOT_FOUND.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.