Coder Social home page Coder Social logo

Comments (12)

amaziagur avatar amaziagur commented on August 17, 2024 31

for some reason npm install typescript --save-dev did the trick for me, can't say i can explain why..

from typescript-tools.

sameera207 avatar sameera207 commented on August 17, 2024 25

@mperdikeas , do u have typescript installed ? if not do

npm install -g typescript

from typescript-tools.

clausreinke avatar clausreinke commented on August 17, 2024 9

Having a globally installed tsc is not the same as having a locally installed, importable typescript module. node is complaining about the latter. Please read the instructions again - you're missing an install step.

from typescript-tools.

overcomer79 avatar overcomer79 commented on August 17, 2024 7

In some case, you need to have typescript installed locally when it is used from an external module. (e.g. tsc-watch) so:
npm install typescript --save-dev
or
npm install typescript --save
depending from your needs.

from typescript-tools.

NanciBotelho avatar NanciBotelho commented on August 17, 2024 3

I was having the same issue and npm install typescript fixed it.

from typescript-tools.

clausreinke avatar clausreinke commented on August 17, 2024 2

PS. if you really want to run bin/tss, instead of a global tss, you need to run npm install in typescript-tools, not npm install -g

from typescript-tools.

TheAngelSilver avatar TheAngelSilver commented on August 17, 2024 1

npm install typescript-tools --save-dev fixed my issue

from typescript-tools.

shrikanthsp22 avatar shrikanthsp22 commented on August 17, 2024 1

can anybody please suggest a soultion for this?
Context : I upgraded a project from angular version 5.2 to 11 and typescript is installed . im using node version 11.2. and im still facing the issue- throw new Error('Could not find local "typescript" package.'

Kindly help

from typescript-tools.

mperdikeas avatar mperdikeas commented on August 17, 2024

@sameera207

See the following trace:

$ sudo npm install -g typescript
npm http GET https://registry.npmjs.org/typescript
npm http 304 https://registry.npmjs.org/typescript
/home/mperdikeas/.node_modules_global/bin/tsserver -> /home/mperdikeas/.node_modules_global/lib/node_modules/typescript/bin/tsserver
/home/mperdikeas/.node_modules_global/bin/tsc ->   /home/mperdikeas/.node_modules_global/lib/node_modules/typescript/bin/tsc
[email protected] /home/mperdikeas/.node_modules_global/lib/node_modules/typescript
mperdikeas@beorn:~/typescript-tools/bin#
$ echo $?
0
mperdikeas@beorn:~/typescript-tools/bin#
$ ./tss 

module.js:340
    throw err;
          ^
Error: Cannot find module 'typescript'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/mperdikeas/typescript-tools/bin/tss.js:6:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

from typescript-tools.

RenukaTh avatar RenukaTh commented on August 17, 2024

I have installed typescript.
Still i am facing the issue.

Error: Cannot find module 'D:\GTMAUTOMATION\node_modules\typescript\bin\tsc'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] pretest: tsc
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] pretest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\495211\AppData\Roaming\npm-cache_logs\2019-08-22T10_01_13_284Z-debug.log
PS D:\GTMAUTOMATION> npm install typescript --save
npm WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible -- are you offline?
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/typescript failed, reason: getaddrinfo ENOTFOUND proxy.company.com proxy.company.com:8080
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in:

from typescript-tools.

tmdwo5811 avatar tmdwo5811 commented on August 17, 2024

for some reason npm install typescript --save-dev did the trick for me, can't say i can explain why..

from typescript-tools.

ambujkhanna avatar ambujkhanna commented on August 17, 2024

I have upgraded my Angular 8 project to Angular 11 and I am start facing this issue with my server.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Ambuj Khanna\Projects\angular_mgration_R&D\STAConsole\server\node_modules\.bin;C:\Python39\Scripts\;C:\Python39\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\SafeNet\Authentication\SAC\x64;C:\Program Files\SafeNet\Authentication\SAC\x32;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\PuTTY\;C:\Program Files\nodejs\;C:\Users\10064213\AppData\Local\Microsoft\WindowsApps;C:\Users\10064213\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\10064213\AppData\Local\GitHubDesktop\bin;C:\Users\10064213\.dotnet\tools;C:\Users\10064213\AppData\Roaming\npm
9 verbose lifecycle [email protected]~start: CWD: C:\Ambuj Khanna\Projects\angular_mgration_R&D\STAConsole\server
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'gulp start' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `gulp start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:314:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:314:20)
13 verbose stack     at maybeClose (internal/child_process.js:1022:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Ambuj Khanna\Projects\angular_mgration_R&D\STAConsole\server
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.22.1
19 verbose npm  v6.14.12
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `gulp start`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

from typescript-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.